home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Games / Xconq 7.0d16 / doc / refman.texi < prev    next >
Encoding:
Text File  |  1993-12-20  |  181.0 KB  |  5,571 lines  |  [TEXT/MPS ]

  1. @node Reference Manual,,,
  2.  
  3. @chapter Reference Manual
  4.  
  5. This manual is the complete description of GDL.
  6. The style is somewhat terse; for more detail on how to
  7. use GDL to design games, see Chapter 3.
  8.  
  9. Symbols followed by @code{??} have not been implemented yet,
  10. so they should be considered as subject to change.
  11.  
  12. @section Language Syntax
  13.  
  14. GDL resembles Lisp, but instead of defining functions,
  15. the contents of a file declare
  16. certain objects (such as units and unit types) to exist
  17. and specify their content.
  18. In other words, GDL is @emph{nonprocedural}.
  19. This means that most of the time, you can list the various
  20. forms in any order you like.
  21. The main restriction is that any symbol, such as a variable
  22. or the name of a type, has to be defined before it is used.
  23. Also, forms such as @code{set} and @code{add}, that set the
  24. value of a variable or property,
  25. always overwrite the previous data irreversibly, 
  26. so ordering of these is very important.
  27.  
  28. @subsection Lexical Elements
  29.  
  30. Numbers are introduced by a decimal digit, plus, or minus signs.
  31. They may contain only decimal digits, a decimal point, and be followed
  32. (immediately, no whitespace allowed)
  33. by a percent sign or a recognized unit of measure.
  34.  
  35. Strings are sequences of characters enclosed by doublequotes (@code{"}).
  36. They may contain any character except ASCII NUL (@code{'\0'}).
  37. To include a doublequote, use backslash, as in @code{"a \"quoted\" string"}.
  38. To include a nonprinting or eight-bit character,
  39. use backslash followed by three octal
  40. digits, which will be interpreted as an eight-bit character code.
  41. (This is mostly the same syntax as in C.)
  42. Note that game design files may be passed over networks
  43. and between different kinds of computer systems,
  44. so non-ASCII characters should not be inserted verbatim into strings.
  45.  
  46. Symbols are sequences of characters that don't
  47. include any of the other special characters.  If you wish to include such
  48. characters in a symbol, enclose it in vertical bars,
  49. for example @code{|foo bar|}.
  50. (The bars are not part of the symbol.)
  51. Symbols are case-sensitive,
  52. but this will be changed eventually.
  53.  
  54. Lists are a sequence of expressions enclosed in parentheses.
  55. The empty list is either @code{nil} or @code{()}.
  56. ``Dotted pairs'' are not allowed.
  57. Anything that is not a list is an @dfn{atom}.
  58.  
  59. All of these objects may range up to a very large size.
  60. (You may still run into bugs if you make strings or symbols
  61. over about 100 chars in length.)
  62.  
  63. Comments are enclosed either within @code{#| |#} (which nests properly,
  64. like Common Lisp and unlike C), or else extend from a semicolon
  65. @code{;} to the end of the line.  A comment is equivalent to whitespace,
  66. so @code{(a#|bcd|#e)} is the same as @code{(a e)}.
  67.  
  68. [@code{#} by itself is a special token]
  69.  
  70. True/false values
  71. are just the integers 0 and 1, with no special characteristics.
  72.  
  73. @deffn GlobalConstant @code{true}
  74. @end deffn
  75. @deffn GlobalConstant @code{false}
  76. These constants are symbolic forms for @code{1} and @code{0}.
  77. They are identical to numbers,
  78. but more descriptive for parameters that are boolean-valued.
  79. @end deffn
  80.  
  81. Unit, material, and terrain types are distinct objects.
  82.  
  83. @subsection Conventions Used
  84.  
  85. Descriptions of values in this manual follow the conventions listed here.
  86.  
  87. For parameters described as @var{t/f},
  88. both @code{1}, @code{0} and @code{true}, @code{false} may be used.
  89. Parameters described as @var{n} and @var{n%} are numbers.
  90. Parameters described as @var{dist} or @var{length}
  91. are also numbers, but are in the unit of measure for lengths.
  92. Parameters described as @var{str} or @var{string} are strings.
  93.  
  94. Parameters described as
  95. @var{u} or @var{ui}, @var{m} or @var{mi}, and @var{t} or @var{ti},
  96. are values that must be unit, material, or terrain types, respectively.
  97.  
  98. Parameters described as @var{utype-value-list} match unit types with values.
  99. They can have several forms:
  100.  
  101. @itemize
  102. @item
  103. @code{(n1 n2 ...)} matches @code{n1} with type 0, etc in order.
  104. @item
  105. @code{((u1 n1) (u2 n2) ...)} evaluates @code{u1} to get a unit type,
  106. then matches it with @code{n1}.  @code{u1} etc may also be a list of
  107. types, in which case all the types get matched with @code{n1}.
  108. @end itemize
  109.  
  110. Other types of lists, such as those defined as @var{side-value-list},
  111. are interpreted similarly. 
  112.  
  113. @subsection Forms and Evaluation
  114.  
  115. A @dfn{form} is either any single expression that appears in the file.
  116. A GDL file consists of a sequence of forms.
  117. Most forms of interest will be lists.
  118. whose first element is a symbol identifying the form.
  119. For instance, a form beginning with the symbol @code{side}
  120. declares a side object.
  121. When the file containing such a form is read, @i{Xconq} will
  122. create a side object and fill in any properties as specified by the form.
  123. (Properties are like properties or attributes - most kinds of objects
  124. have some.)
  125.  
  126. In most contexts, @i{Xconq} will @dfn{evaluate} an expression
  127. before using it, such as when filling in an object's property.
  128. Numbers and strings evaluate to themselves, while symbols
  129. evaluate to their bindings.
  130. Lists evaluate to the same list, but with all the elements
  131. evaluated.
  132.  
  133. @subsection Tables
  134.  
  135. A @dfn{table} is a two-dimensional array of values indexed by types.
  136. Indices can be any pair of unit, material, or terrain type.
  137. The set of tables is fixed by @i{Xconq}, and all are described below.
  138.  
  139. @deffn Form @code{table} table-name items@dots{}
  140. This is the general form to fill in a table.
  141. The table named by @var{table-name} is filled in from the @var{items}.
  142. If an item is an atom, then every position in the
  143. table is filled in with that item, overwriting any
  144. previously-specified values.
  145. If an item is a list, it must be a three-element list
  146. of the form @code{(@var{type1} @var{type2} @var{value})}.
  147. If both @var{type1} and @var{type2} are single types,
  148. then @var{value} will be put into the table at the position
  149. indexed by the two types.
  150. If one of @var{type1} or @var{type2} evaluates to a list,
  151. @i{Xconq} will iterate over all members of the list while
  152. keeping the other type constant,
  153. while if both @var{type1} and @var{type2} are lists,
  154. then @i{Xconq} will iterate over all pairs from the two lists.
  155. The values used during iteration depend on whether the @var{value}
  156. is a list.  If @var{value} is an atom, then that value will just
  157. be used on every iteration.  If a list, then @i{Xconq} will
  158. use successive elements of the list while iterating.
  159. @end deffn
  160.  
  161. The following forms are all equivalent:
  162. @example
  163. (table foo (a y 1) (b y 2) (c y 3) (a z 9) (b z 9) (c z 9))
  164.  
  165. (table foo ((a b c) y (1 2 3)) ((a b c) (z) 9))
  166.  
  167. (define v1 (a b c))
  168. (table foo (v1 y (1 2 3)) (v1 z 9))
  169.  
  170. (table foo ((a b c) (y z) ((1 2 3) (9 9 9))))
  171. @end example
  172.  
  173. @subsection Modifying Objects
  174.  
  175. Since forms normally define or create new objects,
  176. GDL defines the @code{add} form to modify existing objects.
  177.  
  178. @deffn Form @code{add} objects property new-values@dots{}
  179. This form evaluates the atom or list @var{objects} to arrive at the
  180. set of objects to be modified.
  181. Then it uses the @var{new-values} to write new data into
  182. the property named @var{property} of those objects.
  183. The @var{new-values} may be a single number or string, or a list.
  184.  
  185. If @var{objects} is the symbol @code{table}, then this form adds
  186. to a table instead.
  187. @end deffn
  188.  
  189. @subsection Symbols
  190.  
  191. Most of the symbols used in a game module are the predefined ones
  192. described in this manual.
  193. Others are attached to types when the types are defined,
  194. and still others name objects like units and sides.
  195. You can also define and set your own symbols to arbitrary values.
  196.  
  197. @deffn Form @code{define} symbol value
  198. This form defines the symbol @var{symbol} to be bound to the
  199. result of evaluating @var{value}.
  200. If @var{symbol} is already defined, @i{Xconq} will warn about it,
  201. and ignore this form.
  202. @end deffn
  203.  
  204. @deffn Form @code{set} symbol value
  205. This form rebinds the already-bound symbol @var{symbol}
  206. to be bound to the result of evaluating @var{value}.
  207. If @var{symbol} is @emph{not} bound already,
  208. then @i{Xconq} will warn about it, but proceed anyway.
  209. @end deffn
  210.  
  211. @deffn Form @code{undefine} symbol
  212. This form destroys any binding of the @var{symbol}.
  213. This is allowed for any symbol, including already-unbound symbols.
  214. @end deffn
  215.  
  216. @subsection Lists
  217.  
  218. @deffn Operation @code{quote} xxx@dots{}
  219. This operation prevents any evaluation of @var{xxx}.
  220. @end deffn
  221.  
  222. @deffn Operation @code{list} xxx@dots{}
  223. This operation makes a list out of all the @var{xxx}.
  224. @end deffn
  225.  
  226. @deffn Operation @code{append} xxx@dots{}
  227. This operation appends all the @var{xxx} (which may be
  228. lists or not) into a single list.  Non-lists will appear
  229. as though they were single-element lists.
  230. @end deffn
  231.  
  232. @deffn Operation @code{remove} list1 list2
  233. This operation removes the members of @var{list1} from @var{list2}.
  234. @end deffn
  235.  
  236. @section Game Modules
  237.  
  238. The game module declaration supplies information about the file as a whole.
  239. It is optional; if missing, @i{Xconq} will get the module's
  240. name from its file name, and supply defaults for the other properties.
  241.  
  242. @deffn Form @code{game-module} [name] properties@dots{}
  243. This form defines the properties of this game module.
  244. The optional @var{name} is a string that will be used to look up
  245. the module in libraries.
  246. If the @var{name} is supplied, then this form is considered to be the
  247. definition of the module, and overwrites any
  248. @code{game-module} form previously appearing in this file.
  249. If @var{name} is missing, then this form will modify the
  250. existing description of the module.
  251. @end deffn
  252.  
  253. @deffn ModuleProperty @code{title} string
  254. If defined, this property is the name by which the module will be displayed to
  255. players.  It is not used internally, so the name can be modified freely
  256. (unlike the module's name, which may appear in other modules).
  257. Defaults to the module's name. 
  258. @end deffn
  259.  
  260. @deffn ModuleProperty @code{blurb} string
  261. This property is a one-line description that users will see when they
  262. are deciding whether to play the module.
  263. It will be displayed without any modification:
  264. @example
  265. Welcome to my nightmare! (version 1.0 with stronger goblins)
  266. @end example
  267. Defaults to @code{""}.
  268. @end deffn
  269.  
  270. @deffn ModuleProperty @code{picture-name} string
  271. This property is the name of a picture that may be displayed along
  272. with the module's blurb, by those interfaces that support such pictures.
  273. Defaults to @code{""}.
  274. @end deffn
  275.  
  276. @deffn ModuleProperty @code{base-game} t/f
  277. @end deffn
  278.  
  279. @deffn ModuleProperty @code{instructions} strings@dots{}
  280. This property is a list of strings that are the instructions on how to play
  281. the game.  Defaults to @code{()}.
  282. @end deffn
  283.  
  284. @deffn ModuleProperty @code{notes} strings@dots{}
  285. This property is a list of strings comprising the set of
  286. detailed player's notes for the module.
  287. Both the list and each string in the list can be of any length.
  288. When displayed, the strings are all concatenated together, so the division
  289. into strings here is just for convenience.
  290. How these are displayed is up to the interface, but in general an empty
  291. string signals a new paragraph.
  292. Defaults to @code{()}.
  293. @end deffn
  294.  
  295. @deffn ModuleProperty @code{design-notes} strings@dots{}
  296. This property is a list of strings that are notes addressed to game designers.
  297. Defaults to @code{()}.
  298. @end deffn
  299.  
  300. @deffn ModuleProperty @code{version} string
  301. This property is the version of the module.
  302. Defaults to @code{""},
  303. which indicates that the module's version is undefined.
  304. @end deffn
  305.  
  306. @deffn ModuleProperty @code{program-version} versions
  307. This property dentifies @i{Xconq} versions for which this module
  308. is appropriate.
  309. If specified, then players will get a warning if they attempt to use this
  310. module with an inappropriate version of @i{Xconq}.
  311. Possible forms include a string, which allows the module only for
  312. exactly matching version of @i{Xconq},
  313. and @code{(@var{comparison} @var{version})},
  314. which allows versions satisfying the @var{comparison} test,
  315. which may only be @code{>=} or @code{<=}.
  316. So for instance
  317. @example
  318. (game-module "foo" (program-version (>= "7.0.3")))
  319. @end example
  320. is claimed to only work for versions 7.0.3 or later.
  321. Defaults to @code{""}, which means that the module is appropriate for
  322. any version of @i{Xconq}.
  323.  
  324. Notes that the @code{program-version} is strictly a heuristic to forewarn
  325. players; in practice it can be very difficult to know which modules work
  326. with which programs.  (The problems are similar to those encountered
  327. by programmers using different compiler versions on their programs.)
  328. @end deffn
  329.  
  330. @deffn ModuleProperty @code{variants} items@dots{}
  331. This property defines named variants on this module.
  332. Variants appear as startup options for the game.
  333. The items have the form @code{([@var{name}] @var{type} [@var{data}])}.
  334. The @var{name} is a string or symbol used to identify the choice to
  335. the players, the @var{type} says what sort of change is being enabled,
  336. and @var{data} supplies a range of values or content.
  337. The different types of variants are listed below.
  338. A game module may specify any number of variants.
  339. Defaults to @code{()}.
  340. @end deffn
  341.  
  342. @deffn VariantType @code{eval} forms
  343. If this variant is chosen, execute the @var{forms}.
  344. @end deffn
  345.  
  346. @deffn VariantType @code{number} [form sym [lo dflt hi]]
  347. Replace occurrences of the symbol @var{sym} in @var{form}
  348. to a value ranging between @var{lo} and @var{hi},
  349. defaulting to @var{dflt},
  350. then evaluate @var{form}.
  351. @end deffn
  352.  
  353. @deffn VariantType @code{flag} variable dflt
  354. @end deffn
  355.  
  356. @deffn VariantType @code{world-size} [width [height [circumference]]]
  357. This variant allows players to choose the size of the world.
  358. The sizes will default to the values in this variant's data.
  359. (@var{width} and @var{height} can be lists of the form @code{(lo dflt hi)},
  360. with the obvious interpretation??)
  361. @end deffn
  362.  
  363. @deffn VariantType @code{world-seen} dflt
  364. This variant allows players to choose whether
  365. the terrain of the world will be known at the start of the game.
  366. The default setting will be the value @code{dflt},
  367. which may be either @code{true} or @code{false}.
  368. @end deffn
  369.  
  370. @deffn VariantType @code{see-all} dflt
  371. This variant allows players to choose whether everything will be seen
  372. always, as with the global variable @code{see-all}.
  373. The default is set by @code{dflt}.
  374. @end deffn
  375.  
  376. @deffn ModuleProperty @code{base-module} name
  377. This property is the name of a module that must be loaded first.
  378. It is similar in effect to @code{include}.
  379. @end deffn
  380.  
  381. @deffn ModuleProperty @code{default-base-module} name
  382. This property specifies the name of a module that will be loaded
  383. if this module is given as the ``top-level'' module,
  384. such as via @code{-g} on a command line.
  385.  
  386. This is to prevent disasters when a library module that is
  387. used only by other modules is instead loaded as if it were
  388. a full game design.
  389. @end deffn
  390.  
  391. @subsection Including Other Modules
  392.  
  393. You can include one game module in another.
  394.  
  395. @deffn Form @code{include} [if-needed] module-name [variant-settings]
  396. This form has the effect of inserting the contents
  397. of @var{module-name} into the current position in the module.
  398. @code{game-module} forms in the included module are not inserted,
  399. although they are remembered and may appear in displays.
  400. @i{Xconq} will fail completely if the included module cannot be found.
  401.  
  402. Unlike C etc, the same module cannot be included more than once; you will
  403. get a warning and the module will not be loaded.
  404. @end deffn
  405.  
  406. Note that the module names are not file names,
  407. so that system-specific features like directories and devices
  408. cannot be included.
  409. The mapping between module name and file name is interface-specific,
  410. so if you want to distribute a module, you should make sure all the
  411. module names don't have anything nonportable embedded.
  412. Alphanumeric characters and hyphens are guaranteed to be portable.
  413.  
  414. @subsection Conditional Loading
  415.  
  416. [not really implemented yet - need a conditional stack, check matching
  417. end, complain if no match - add do/skip flag to interp_form]
  418.  
  419. @deffn Form @code{if} sym test-form
  420. @end deffn
  421.  
  422. @deffn Form @code{else} sym
  423. @end deffn
  424.  
  425. @deffn Form @code{end-if} sym
  426. @end deffn
  427.  
  428. @node World Design, Distances and Elevations, Language, Game Design
  429.  
  430. @section The World
  431.  
  432. The world consists of a set of @dfn{areas} (only one at present),
  433. each of which is regular in shape and consists of a number of cells.
  434. Each cell has a type of terrain and a number of optional pieces of data.
  435. Each kind of per-cell data will be called a @dfn{layer} of the area.
  436.  
  437. @deffn Form @code{world} [circumference] properties@dots{}
  438. This form defines the properties of the world as a whole.
  439. @end deffn
  440.  
  441. @deffn WorldProperty @code{circumference} dist
  442. This property is the distance around the entire world (as a sphere).
  443. Default is @code{360}.
  444. @end deffn
  445.  
  446. @deffn WorldProperty @code{axial-tilt} n
  447. This property defines the extremes of seasonal changes.
  448. @end deffn
  449.  
  450. @deffn Form @code{area} [width [height]] [restriction] properties@dots{}
  451. This form defines the playing area of the world.
  452. The @var{restriction} identifies how to get data for this area from
  453. subsequent forms that are based on larger areas.
  454. @end deffn
  455.  
  456. @deffn AreaRestriction @code{restrict} w h x y
  457. This is a special form that specifies that subsequent layers in an
  458. area of size w x h will be offset by x,y and then read into the
  459. actual area.  [obscure explanation, see the library for examples]
  460. @end deffn
  461.  
  462. @deffn AreaProperty @code{width} n
  463. @end deffn
  464. @deffn AreaProperty @code{height} n
  465. These properties are the width and height of the world,
  466. as measured in cells.
  467. Allowable values range from 3x3
  468. up to 32767x32767, which is one billion cells!
  469. If only one of these is given, then the other defaults to the same value.
  470. If neither has been given, then they default to @code{60} and @code{30},
  471. respectively.
  472. @end deffn
  473.  
  474. In the case of a cylinder, the world wraps around
  475. in the x direction, and the width is the diameter of the cylinder,
  476. while the height is just the
  477. height in the usual sense.
  478. A hexagon world is flat on the top and bottom; its width is
  479. measured across the middle height, which is the largest span,
  480. and height is the same
  481. as for cylinders.  Here are some crude pictures, first of an 8x6 cylinder:
  482. @example
  483. # # # # # # # #
  484.  : : + + : : : :
  485. : : : + ^ : : :
  486.  : : : : : : : :
  487. : : : : ^ : : :
  488.  # # # # # # # #
  489. @end example
  490.  
  491. This world is an 8x7 hexagon:
  492. @example
  493.    # # # # # 
  494.   # : + + : #
  495.  # : : + ^ : #
  496. # : : + ^ : : #
  497.  # : : : : : #
  498.   # : : ^ : #
  499.    # # # # # 
  500. @end example
  501.  
  502. There are two kinds of properties that an area may have:
  503. scalar values such as latitude, 
  504. and layer values such as terrain and elevation.
  505.  
  506. @deffn AreaProperty @code{latitude} n
  507. This property is the offset from the equator of the middle of the area
  508. (height / 2).
  509. Defaults to @code{0}.
  510. @end deffn
  511. @deffn AreaProperty @code{longitude} n
  512. Defaults to @code{0}.
  513. @end deffn
  514.  
  515. @subsection Layers
  516.  
  517. @dfn{Layers} constitute the bulk of data about an area of the world.
  518. Each layer assigns a value to each cell in the area;
  519. examples include cell terrain, temperatures, elevations, and so forth.
  520. Since there may be many cells in a layer with the same values,
  521. each layer uses a common run-length encoding scheme.
  522. In this scheme, each horizontal band of cells
  523. is a separate text string, and the contents of the string encode
  524. individual numeric values, one for each cell.
  525. The encoding uses the characters @code{a..~} and @code{:..[}
  526. for 0 through 63,
  527. and decimal digits followed by commas (or the end of the string)
  528. for all other numbers.
  529. Runs of constant value are prefixed with their length, in decimal.
  530. Thus, the string
  531. @example
  532. "40adaa100,2*-99"
  533. @end example
  534. represents 46 values in all: 40 zeroes, a three, 2 more zeros, a 100,
  535. and two -99s.
  536. Although this format is totally unreadable,
  537. it has the advantages of compactness and portability;
  538. the expectation is that most layer editing will be done on-line.
  539. Note that the run encoding is entirely optional.
  540.  
  541. The following subforms at the beginning of layer data have special effects:
  542.  
  543. @deffn LayerSubform @code{constant} n
  544. This subform causes every value in the layer to be set to @var{n}.
  545. @end deffn
  546.  
  547. @deffn LayerSubform @code{subarea} x y w h
  548. This subform indicates that the layer data should be positioned at the given
  549. rectangle in the layer.
  550. @end deffn
  551.  
  552. @deffn LayerSubform @code{xform} mul add
  553. This subform has the effect of first multiplying the raw value by @var{mul},
  554. then adding @var{add} and storing the result into the layer.
  555. @end deffn
  556.  
  557. @deffn LayerSubform @code{by-bits}
  558. @end deffn
  559.  
  560. @deffn LayerSubform @code{by-char} str
  561. This subform specifies that the characters in @var{str} give the
  562. encodings of values in the layer.
  563. The first character in @var{str} encodes 0, the second encodes 1,
  564. and so forth.
  565. @end deffn
  566.  
  567. @deffn LayerSubform @code{by-name} name-list
  568. [what is the syntax of name-list exactly?]
  569. This subform is for generic worlds that are useful across multiple game designs.
  570. The value/name pairs allow for the matching of terrain types by name,
  571. so that if, say,
  572. the ``sea'' terrain type was type #0 in one game and type #4 in another,
  573. the world would have sea in all the same places after it was read in.
  574. In practice, only a few worlds are this general.
  575. If a named terrain type is not present, @i{Xconq} will warn about it
  576. and substitute type 0.
  577. @end deffn
  578.  
  579. @deffn AreaProperty @code{terrain} layer-data@dots{}
  580. This property is the actual layer of terrain types for cells.
  581. @end deffn
  582.  
  583. @deffn AreaProperty @code{aux-terrain} terrain-type layer-data@dots{}
  584. This property fills in values for borders, connections, and coatings.
  585. For border and connection terrain,
  586. the value is a six-bit number (0..63),
  587. with a bit turned on in each direction that there is a border
  588. or connection.
  589. For coating types, the value is the depth of the coating.
  590. @end deffn
  591.  
  592. @deffn AreaProperty @code{features} feature-list layer-data@dots{}
  593. This property specifies the nature and location of all geographical features.
  594. The @var{feature-list} is a list of lists, where each sublist has the form
  595. @code{([@var{id}] @var{typename} @var{name} [@var{super}])}
  596. where @var{id} is the numerical id referenced in the layer data
  597. (defaults to feature's position in the @var{feature-list}),
  598. @var{typename} is a symbol or string giving the general type of feature
  599. (such as @code{bay}),
  600. @var{name} is the name of the feature
  601. (such as @code{"Bay of Bengal"}),
  602. and @var{super} is the optional id of another feature that
  603. incorporates this feature.
  604. @end deffn
  605.  
  606. @deffn AreaProperty @code{material} material-type layer-data@dots{}
  607. This property declares the quantity of the given @var{material-type}
  608. in each cell of the area.
  609. @end deffn
  610.  
  611. @deffn AreaProperty @code{people-sides} layer-data@dots{}
  612. This property says which side the people of each cell are on.
  613. A @var{side-encoding} of @code{exact} assigns 0 to independence (no side),
  614. 1 to the first side, and so forth; otherwise, the encoding is a list
  615. of side names/ids and numbers.
  616. @end deffn
  617.  
  618. @subsection Distances and Elevations
  619.  
  620. @deffn AreaProperty @code{elevations} layer-data@dots{}
  621. This property is the world elevation data itself.
  622. If any elevation falls outside the min/max elevation range
  623. for the terrain type of the cell, then it
  624. will be truncated appropriately.
  625. Defaults to @code{0} for each cell.
  626. @end deffn
  627.  
  628. @deffn AreaProperty @code{cell-width} dist
  629. This property is the distance across a single cell,
  630. expressed as units of elevation.  Defaults to @code{1}.
  631. [this *must* be a long...]
  632. @end deffn
  633.  
  634. @subsection Temperatures
  635.  
  636. Each type of terrain has a temperature range in which it may be found.
  637. Any calculation that would fall outside this range will be clipped.
  638.  
  639. The temperature can be set to have a given value at a given elevation.
  640. All air temperatures will be interpolated appropriately.
  641.  
  642. @deffn GlobalVariable @code{temperature-floor} n
  643. This variable is the lowest possible temperature.
  644. Defaults to @code{0}.
  645. @end deffn
  646.  
  647. @deffn GlobalVariable @code{temperature-floor-elevation} n
  648. This variable is the elevation at which the temperature is always at
  649. @code{temperature-floor}.
  650. Defaults to @code{0}.
  651. @end deffn
  652.  
  653. @deffn AreaProperty @code{temperatures} layer-data@dots{}
  654. This property contains the temperature data itself.
  655. If any temperature falls outside the min/max temperature range, then it
  656. will be truncated appropriately.
  657. Defaults to @code{0} for each cell.
  658. @end deffn
  659.  
  660. @subsection Winds
  661.  
  662. Winds are defined as having a nonnegative force and a direction.
  663.  
  664. @deffn AreaProperty @code{winds} layer-data@dots{}
  665. This property contains the force and direction of the prevailing
  666. winds in each cell.
  667. @end deffn
  668.  
  669. @subsection Clouds
  670.  
  671. @deffn AreaProperty @code{clouds} layer-data@dots{}
  672. @end deffn
  673.  
  674. @deffn AreaProperty @code{cloud-bottoms} layer-data@dots{}
  675. @end deffn
  676.  
  677. @deffn AreaProperty @code{cloud-heights} layer-data@dots{}
  678. @end deffn
  679.  
  680. @section Sides
  681.  
  682. @deffn Form @code{side} [id] properties@dots{}
  683. This form has the effect of declaring a side to exist.
  684. If the number or symbol @var{id} is supplied and
  685. matches that of a side that has already been created,
  686. then the properties will modify the pre-existing side.
  687. Otherwise a new side object will be created,
  688. with a arbitrarily-chosen numeric id ranging between 1 and @code{sides-max}.
  689. If the given @var{id} is a symbol, then the side object will be
  690. bound to that symbol.
  691. @end deffn
  692.  
  693. @deffn GlobalVariable @code{sides-min} n
  694. @end deffn
  695. @deffn GlobalVariable @code{sides-max} n
  696. These variables are the minimum and maximum number of sides that may exist in
  697. a game.  Defaults are to @code{1} and the internal parameter @code{MAXSIDES},
  698. which is usually around 7.
  699. @code{MAXSIDES} can only be changed by recompiling @i{Xconq}.
  700. @end deffn
  701.  
  702. @deffn Form @code{side-defaults} properties@dots{}
  703. This form sets the defaults for all newly-created sides declared
  704. subsequently.
  705. These defaults will be set before the new side's properties are interpreted.
  706. This form has no effect on existing sides or on side declarations that
  707. modify existing sides.
  708. @end deffn
  709.  
  710. @subsection Name and Related Properties
  711.  
  712. If the game design allows, all of these properties can be set at startup by
  713. the players (see <side config> and below).
  714. Omission of some of these results in suppression or substitution,
  715. depending on the interface and the situation.
  716. Omission of all name properties allows the side to go unmentioned,
  717. which is useful when the concept of ``side'' is useless or
  718. confusing to a player (as in some adventure games).
  719. All of these properties may be set at any time by any player.
  720.  
  721. @deffn SideProperty @code{name} str
  722. This property is the proper name of a side, as a country or alliance name.
  723. Examples include @code{"Axis"} and @code{"Hyperborea"}.
  724. Defaults to @code{""}.
  725. @end deffn
  726.  
  727. @deffn SideProperty @code{long-name} str
  728. This property is the long form of a side's name,
  729. as in @code{"People's Republic of Hyperborea"}.
  730. Defaults to be the same as the side's name.
  731. @end deffn
  732.  
  733. @deffn SideProperty @code{short-name} str
  734. This property is an short name or acronym for the side,
  735. often just the letters of the long name, as in @code{"PRH"}.
  736. Defaults to @code{""}.
  737. @end deffn
  738.  
  739. @deffn SideProperty @code{noun} str
  740. This property is the name of an individual unit or person
  741. belonging to the side.
  742. Defaults to @code{""}, which suppresses any mention of the side
  743. when (textually) describing the individual.
  744. @end deffn
  745.  
  746. @deffn SideProperty @code{plural-noun} str
  747. This property is what you would call a group of individuals.
  748. Defaults to the most common plural form of the @code{noun}
  749. (in English, the default pluralizer adds an ``s''),
  750. so any alternative plural noun, such as @code{"Chinese"},
  751. will need an explicit @code{plural-noun} value.
  752. @end deffn
  753.  
  754. @deffn SideProperty @code{adjective} str
  755. This property is an adjective that can be used of individuals on the side,
  756. as in @code{"Spanish"}.
  757. Defaults to @code{""}, which suppresses use of the adjective.
  758. @end deffn
  759.  
  760. As a complete example, a side named @code{"Poland"} would have a long name
  761. @code{"Kingdom of Poland"}, short name @code{"Po"},
  762. noun @code{"Pole"}, plural noun @code{"Poles"},
  763. and adjective @code{"Polish"}.
  764.  
  765. @deffn SideProperty @code{color-scheme} str
  766. @end deffn
  767. @deffn SideProperty @code{colors} str
  768. @end deffn
  769. @deffn SideProperty @code{color} str
  770. This property is a comma-separated list of colors that represents the side.
  771. Defaults to @code{"black"}.  (The three forms are just synonyms.)
  772. @end deffn
  773.  
  774. @deffn SideProperty @code{emblem-name} str
  775. This property is the name of a graphical icon that represents the side.
  776. An emblem name of @code{"none"} suppresses any emblem display for the side.
  777. Defaults to @code{""}, which gives the side a randomly-selected emblem.
  778. @end deffn
  779.  
  780. @deffn SideProperty @code{names-locked} t/f
  781. If the value of this property is @code{true},
  782. then the player cannot modify any of the side's names.
  783. Defaults to @code{false}.
  784. @end deffn
  785.  
  786. @subsection Side Class
  787.  
  788. @deffn SideProperty @code{class} str
  789. This property is a side's class, which is a keyword that characterizes the side.
  790. Any number of sides may be in the same class.
  791. @end deffn
  792.  
  793. @subsection Status in Game
  794.  
  795. Once a side is in the game, it can never be totally removed.
  796. However, sides can become inactive.
  797.  
  798. @deffn SideProperty @code{active} t/f
  799. This property is @code{true} if the side is still actively participating in the game.
  800. If the side has won, lost, or simply withdrew, this will be @code{false}.
  801. Any units on a side not in the game are effectively frozen statues;
  802. they don't do anything, and are untouchable by anyone else.
  803. Defaults to @code{true}.
  804. @end deffn
  805.  
  806. @deffn SideProperty @code{status} lose/draw/win
  807. This property tells how this side did in the game.  Defaults to @code{draw}.
  808. @end deffn
  809.  
  810. @deffn GlobalConstant @code{win}
  811. @end deffn
  812. @deffn GlobalConstant @code{draw}
  813. @end deffn
  814. @deffn GlobalConstant @code{lose}
  815. These constants are the different possible values for a side's status.
  816. @end deffn
  817.  
  818. @deffn SideProperty @code{advantage}
  819. @end deffn
  820. @deffn SideProperty @code{advantage-min}
  821. @end deffn
  822. @deffn SideProperty @code{advantage-max}
  823. @end deffn
  824.  
  825. @subsection Side Relationships
  826.  
  827. By default, sides are neutral with respect to each other.
  828.  
  829. Control is a situation where one side
  830. can observe and move another side's units, but not vice versa.
  831. The controlling side can also just take the units of the controlled side.
  832. If the controlled side loses or resigns, then the controlling side
  833. automatically gets everything.
  834. Both sides must agree to this relationship.
  835.  
  836. @deffn SideProperty @code{controlled-by} side
  837. This property refers to the side controlling this one.
  838. If 0, then the side is not under control.
  839. Defaults to @code{0}.
  840. @end deffn
  841.  
  842. The closest side relationship is one of trust.
  843. A trusted side unit's may do anything at any time,
  844. including entering and leaving units on the other side,
  845. consuming the other side's materials, and so forth.
  846.  
  847. @deffn SideProperty @code{trusts} side-value-list
  848. This property is true for any side that is trusted by this side.
  849. Note that this relationship need not be symmetrical.
  850. Defaults to @code{false} for all sides.
  851. @end deffn
  852.  
  853. Note that these parameters apply only to relationships as enforced by
  854. @i{Xconq}.  In an actual game, both human and robot sides can make agreements
  855. and have positive/negative opinions about the other sides.
  856.  
  857. @deffn SideProperty @code{trades} side-value-list
  858. This property defines the trading relationship with other sides.
  859. @end deffn
  860.  
  861. @subsection Numbering Units
  862.  
  863. @deffn SideProperty @code{next-numbers} utype-value-list
  864. This property gives the next serial numbers that will be assigned to units
  865. acquired by this side.
  866. Defaults to @code{1} for each unit type (Dijkstra notwithstanding,
  867. that's still where people start numbering things).
  868. @end deffn
  869.  
  870. If the unit is of a type that gets numbered
  871. (@code{assign-number} property is true),
  872. then any unit of that type, acquired by any means whatsoever,
  873. will be assigned the @code{next-numbers} value for that type
  874. and @code{next-numbers} will be incremented.
  875.  
  876. @subsection Side-Specific Namers
  877.  
  878. A side can have its own set of namers (see below)
  879. that will be used for units
  880. and geographical features associated with that side.
  881.  
  882. @deffn SideProperty @code{unit-namers} utype-value-list
  883. This property specifies which namers will be used with which types
  884. that the side starts out with or creates new units.
  885. These will not be run automatically on captured units or gifts.
  886. Defaults to @code{""} for each unit type.
  887. @end deffn
  888.  
  889. @deffn SideProperty @code{feature-namers} feature-type-value-list
  890. This property specifies which namers to use with which geographical
  891. features in the side's initial country (if if has one).
  892. Defaults to @code{()}.
  893. @end deffn
  894.  
  895. @subsection Tech Levels
  896.  
  897. The tech level of a side determines what it can do with each type of unit.
  898.  
  899. @deffn SideProperty @code{tech} utype-value-list
  900. This property assigns a tech level to each unit type named.
  901. Defaults to @code{0} for each unit type.
  902. @end deffn
  903.  
  904. @deffn SideProperty @code{init-tech} utype-value-list
  905. This property is the tech level at the beginning of the current turn.
  906. Defaults to @code{0} for each unit type.
  907. @end deffn
  908.  
  909. @subsection Views
  910.  
  911. These properties are necessary only if the relevant globals
  912. are set a certain way (@code{see-all} is false, etc).
  913.  
  914. @deffn SideProperty @code{terrain-view} layer-data@dots{}
  915. This property is the side's current knowledge of the world's terrain.
  916. Defaults to @code{()}.
  917. @end deffn
  918.  
  919. @deffn SideProperty @code{unit-view} layer-data@dots{}
  920. This property is the side's current knowledge of the world.
  921. Defaults to @code{()}.
  922. @end deffn
  923.  
  924. @deffn SideProperty @code{unit-view-dates} layer-data@dots{}
  925. This property is the turn number at which the unit view data
  926. in the corresponding cell of the @code{unit-view} was set.
  927. Defaults to @code{()}.
  928. @end deffn
  929.  
  930. @subsection Interaction
  931.  
  932. @deffn SideProperty @code{turn-time-used} seconds
  933. This property is the number of (real) seconds
  934. that this side has been moving units during the present turn.
  935. Defaults to @code{0}.
  936. @end deffn
  937.  
  938. @deffn SideProperty @code{total-time-used} seconds
  939. This property is the number of (real) seconds that
  940. this side has been moving units during the course of the game.
  941. Defaults to @code{0}.
  942. @end deffn
  943.  
  944. @deffn SideProperty @code{timeouts} n
  945. This property is the number of ``time outs'' a side gets for the game.
  946. Defaults to @code{0}.
  947. @end deffn
  948.  
  949. @deffn SideProperty @code{timeouts-used} n
  950. This property is the number of ``time outs'' a side has already used up.
  951. Defaults to @code{0}.
  952. @end deffn
  953.  
  954. @deffn SideProperty @code{finished-turn} t/f
  955. This property is true if the side has declared that it is finished moving
  956. things during this turn.
  957. Defaults to @code{false}.
  958. @end deffn
  959.  
  960. @deffn SideProperty @code{willing-to-draw} t/f
  961. This property is true if the side will go along
  962. with any other side that wants to end the game.
  963. Defaults to @code{false}.
  964. @end deffn
  965.  
  966. @deffn SideProperty @code{ai} xxx
  967. This property is information about the AI associated with a side.
  968. Defaults to @code{()}.
  969. @end deffn
  970.  
  971. @deffn SideProperty @code{respect-neutrality} t/f
  972. @end deffn
  973.  
  974. @deffn SideProperty @code{real-timeout} seconds
  975. This property is the number of (real) seconds to wait before declaring the
  976. side to be finished with this turn.
  977. Defaults to @code{-1}, which waits forever.
  978. @end deffn
  979.  
  980. @deffn SideProperty @code{real-time-used} seconds
  981. This property is the total number of seconds used by this side already in the game.
  982. @end deffn
  983.  
  984. @deffn SideProperty @code{task-limit}
  985. This property is the maximum number of tasks a unit is allowed to stack up.
  986. @end deffn
  987.  
  988. @subsection Doctrine
  989.  
  990. Doctrines are objects that units consult to decide about individual behavior.
  991.  
  992. @deffn SideProperty @code{doctrines} utype-property-groups@dots{}
  993. This property is the side's unit-type-specific doctrine.
  994. Each @var{utype-property-group} has the form
  995. @code{(@var{unit-types} properties@dots{})}.
  996. Defaults to @code{()}.
  997. @end deffn
  998.  
  999. @deffn SideProperty @code{doctrines-locked} t/f
  1000. @end deffn
  1001.  
  1002. @deffn Form @code{doctrine} [id] properties@dots{}
  1003. This form creates a doctrine with the given id and properties.
  1004. @end deffn
  1005.  
  1006. @deffn DoctrineProperty @code{ever-ask-side} t/f
  1007. This property is the true if the unit may ask the player for what to do,
  1008. instead of picking some default activity.
  1009. @end deffn
  1010.  
  1011. @deffn DoctrineProperty @code{avoid-bad-terrain} n%
  1012. This property is the probability that the unit will not enter
  1013. unhealthy terrain, even if it delays meeting goals.
  1014. Unhealthy means higher attrition and accident probs, materials
  1015. consumed faster than replaced, slower movement.
  1016. Defaults to @code{0}.
  1017. @end deffn
  1018.  
  1019. @deffn DoctrineProperty @code{repair-at} n%
  1020. This property indicates that when the unit's hp is at @var{n%} of max,
  1021. make a plan to repair.
  1022. Defaults to @code{50}.
  1023. @end deffn
  1024.  
  1025. @deffn DoctrineProperty @code{resupply-at} n%
  1026. This property indicates that when the level of a
  1027. operationally-consumed material is at @var{n%}
  1028. of capacity, try to resupply.
  1029. Defaults to @code{50}.
  1030. @end deffn
  1031.  
  1032. @deffn DoctrineProperty @code{rearm-at} n%
  1033. This property indicates that when the level of a
  1034. combat-consumed material is at @var{n%}
  1035. of capacity, try to resupply.
  1036. Defaults to @code{50}.
  1037. @end deffn
  1038.  
  1039. @deffn DoctrineProperty @code{fill-percentage} n%
  1040. This property indicates that when a transport is waiting for occupants,
  1041. plan to wait until the number of occupants is this percentage of capacity.
  1042. Defaults to @code{80}.
  1043. @end deffn
  1044.  
  1045. @deffn DoctrineProperty @code{expendability} n
  1046. This property is the odds at which a unit will be willing to attack.
  1047. @end deffn
  1048.  
  1049. @deffn DoctrineProperty @code{locked} t/f
  1050. This property is true if the doctrine cannot be modified by the player.
  1051. Defaults to @code{false}.
  1052. @end deffn
  1053.  
  1054. @subsection Other
  1055.  
  1056. @deffn SideProperty @code{self-unit} unit
  1057. This property is the id of a unit that represents the side itself.
  1058. Defaults to @code{0}, which means that no unit represents the side.
  1059. See below for more details on self units.
  1060. @end deffn
  1061.  
  1062. @deffn SideProperty @code{priority} n
  1063. @end deffn
  1064.  
  1065. @deffn SideProperty @code{scores} list
  1066. @end deffn
  1067.  
  1068. @deffn Form @code{independent-units} properties@dots{}
  1069. Like the @code{side} form, but sets properties for independent units.
  1070. @end deffn
  1071.  
  1072. @deffn SideProperty @code{ui-prefs}
  1073. This property contains interface-specific data for the side.
  1074. This is mainly for preservation across game save/restores,
  1075. and its form is defined by the interface.
  1076. @end deffn
  1077.  
  1078. @section Players
  1079.  
  1080. Player objects are rarely necessary when building game designs;
  1081. they typically only appear in saved games,
  1082. in order to ensure that the same players get the same sides
  1083. upon restoration.
  1084.  
  1085. @deffn SideProperty @code{player} id
  1086. This property is the unique identifier of a player that is running this side.
  1087. Defaults to @code{0}, which means that no player has been assigned
  1088. to the side.
  1089. @end deffn
  1090.  
  1091. @deffn Form @code{player} [id] properties@dots{}
  1092. This form defines players.
  1093. If the @var{id} is supplied and matches an existing player id,
  1094. then the player object is updated using the @var{properties},
  1095. otherwise a new player object will be created, using the given @var{id}
  1096. if supplied.
  1097. @end deffn
  1098.  
  1099. @deffn GlobalVariable @code{player-sides-locked} t/f
  1100. This variable is @code{true} when the player/side assignment may not
  1101. be changed while the game is starting up.
  1102. Defaults to @code{false}.
  1103. @end deffn
  1104.  
  1105. The number of players must always be less than the number of sides
  1106. (sides without players just don't do anything).
  1107.  
  1108. @deffn PlayerProperty @code{name} str
  1109. This property identifies the player by name.
  1110. Defaults to @code{""}.
  1111. @end deffn
  1112.  
  1113. @deffn PlayerProperty @code{config-name} str
  1114. This property identifies a particular set of doctrine and other definitions
  1115. that the player is using.
  1116. Defaults to @code{""}.
  1117. @end deffn
  1118.  
  1119. @deffn PlayerProperty @code{display-name} str
  1120. This property identifies the display being used by the player's interface.
  1121. Defaults to @code{""}.
  1122. @end deffn
  1123.  
  1124. @deffn PlayerProperty @code{ai-type-name} str
  1125. This property is the type of AI that will play the side if requested or necessary.
  1126. The set of choices depends on what has been compiled into @i{Xconq}.
  1127. (The general-purpose AI type @code{"mplayer"} will usually be available,
  1128. but is not guaranteed.)
  1129. An @code{ai-type-name} of @code{""} means that no AI will run this player.
  1130. Defaults to @code{""}.
  1131. @end deffn
  1132.  
  1133. @deffn PlayerProperty @code{password} str
  1134. This property is the encoding of a password that must be entered before this
  1135. player object can be reused successfully.
  1136. Defaults to @code{""}.
  1137. @end deffn
  1138.  
  1139. @deffn PlayerProperty @code{initial-advantage} n
  1140. This property is an initial relative strength at which the player should start.
  1141. Some synthesis methods can use this to give more units or some other
  1142. advantage to each player according to the requested strength.
  1143. Defaults to @code{1}.
  1144. @end deffn
  1145.  
  1146. @deffn GlobalVariable @code{advantage-min} n
  1147. @end deffn
  1148. @deffn GlobalVariable @code{advantage-max} n
  1149. @end deffn
  1150. @deffn GlobalVariable @code{advantage-default} n
  1151. These variables set the bounds and default values for players'
  1152. initial advantages.
  1153. An @code{advantage-max} of @code{0} means that there is no upper
  1154. bound on initial advantage (however, @i{Xconq} syntheses may not
  1155. be able to synthesize such a game).
  1156. Default to @code{1}, @code{0}, and @code{1}.
  1157. @end deffn
  1158.  
  1159. @subsection Rules of Side Configuration
  1160.  
  1161. The properties of a side can come from a number of different sources (here listed
  1162. in order of precedence):
  1163.  
  1164. @itemize
  1165.  
  1166. @item
  1167. Interface-specific sources (X resources, Mac preferences).
  1168.  
  1169. @item
  1170. Game-specific form in side config file (matched by module name).
  1171.  
  1172. @item
  1173. Generic form in side config file.
  1174.  
  1175. @item
  1176. The @code{side} form for the side.
  1177.  
  1178. @item
  1179. The @code{side-defaults} form.
  1180.  
  1181. @item
  1182. General program defaults.
  1183. @end itemize
  1184.  
  1185. Note that interface-specific and general config files can never alter
  1186. certain properties of a side, and can only alter others if they are
  1187. not locked.
  1188.  
  1189. @section Units
  1190.  
  1191. The basic @code{unit} form creates or modifies a unit.
  1192.  
  1193. @deffn Form @code{unit} id [type] properties@dots{}
  1194. This form defines a unit.
  1195. If a numeric @var{id} is supplied and matches the id of an existing unit,
  1196. then that unit will be modified by @var{properties},
  1197. and the optional @var{type} will be interpreted as a new type for the unit.
  1198. Otherwise a new unit will be created,
  1199. with either @var{id} as its id or
  1200. a arbitrarily-selected one if @var{id} is already in use.
  1201. If the unit's id is newly-generated and no type has been specified,
  1202. then type #0 (first-defined type) will be the type of the unit.
  1203. An id of @code{0} can never match an existing unit id, so effect
  1204. will be as if it had been omitted.
  1205. @end deffn
  1206.  
  1207. @deffn Form @var{unit-type-name} x y [side-id] properties@dots{}
  1208. This is an abbreviated form, in which
  1209. the x,y position is required, and an optional side id may be included.
  1210. The @var{unit-type-name} may be any valid unit type name or
  1211. defined name.
  1212. @end deffn
  1213.  
  1214. Since there may be many units whose properties are similar, there
  1215. is a ``default unit'' whose properties fill in missing properties in
  1216. individual unit declarations.
  1217.  
  1218. @deffn Form @code{unit-defaults} reset properties@dots{}
  1219. This form sets the default values for all subsequent units read in,
  1220. in this and every other module not yet loaded.
  1221. The set of defaults is additive,
  1222. so for instance you can repeatedly change the default side of units.
  1223. If the optional symbol @code{reset} has been supplied for @var{reset},
  1224. then all the defaults will be changed to the basic default
  1225. values, as described in this manual.
  1226. @end deffn
  1227.  
  1228. @deffn Symbol @code{reset}
  1229. @end deffn
  1230.  
  1231. @subsection Unit Properties
  1232.  
  1233. This section lists properties of individual units.
  1234. In general, they default to the most common or reasonable values,
  1235. so need not always be specified, even in a saved game.
  1236.  
  1237. @deffn UnitProperty @code{@@} x y [z]
  1238. This property is the position of the unit.
  1239. Defaults to @code{-1,-1,0}, which causes the unit to be placed randomly.
  1240. The optional altitude @var{z} can also be set separately with
  1241. the property @code{z} below.
  1242. If @i{z} is even and the unit is in the open,
  1243. then the unit's altitude is @i{z/2};
  1244. if @i{z} is odd, then @i{(z-1)/2} is the type of connection terrain
  1245. that the unit is on.
  1246. @end deffn
  1247.  
  1248. @deffn UnitProperty @code{z} z
  1249. This property is identical to the optional z part of the @code{@@} property. 
  1250. Defaults to @code{0}.
  1251. @end deffn
  1252.  
  1253. @deffn UnitProperty @code{s} side
  1254. This property is the side of the unit.
  1255. It can be either a side name/noun/adjective (string) or id (number).
  1256. A value of @code{0} or @code{"independent"}
  1257. means that the unit is independent.
  1258. Defaults to @code{0}.
  1259. @end deffn
  1260.  
  1261. @deffn UnitProperty @code{#} n
  1262. This property is the id of the unit.
  1263. Defaults to a game-selected value.
  1264. @end deffn
  1265.  
  1266. @deffn UnitProperty @code{n} str
  1267. This property is the name of the unit.
  1268. Defaults to @code{""}.
  1269. @end deffn
  1270.  
  1271. @deffn UnitProperty @code{nm} n
  1272. This property is the number of the unit,
  1273. which starts at @code{1} and goes up.
  1274. Defaults to @code{0}, which means that the unit is unnumbered.
  1275. @end deffn
  1276.  
  1277. @deffn UnitProperty @code{cp} n
  1278. This property is the current completeness of the unit.
  1279. If negative, indicates that the unit will appear at a time
  1280. and place specified by the @code{appear} x-property.
  1281. Defaults to the @code{cp-max} for the type.
  1282. @end deffn
  1283.  
  1284. @deffn UnitProperty @code{hp} n
  1285. This property is the current hit points of the unit.
  1286. Will be restricted to the range [0, hp-max].
  1287. An hp of 0 means that the unit is dead and will not appear in the game.
  1288. Defaults to @code{hp-max} for the unit's type.
  1289. @end deffn
  1290.  
  1291. @deffn UnitProperty @code{cxp} cxp
  1292. This property is the combat experience of the unit.
  1293. Defaults to @code{0}.
  1294. @end deffn
  1295.  
  1296. @deffn UnitProperty @code{m} mtype-value-list
  1297. This property is the amounts of supplies being carried by the unit.
  1298. Defaults to @code{0} for each material type.
  1299. @end deffn
  1300.  
  1301. @deffn UnitProperty @code{tp} utype-value-list
  1302. This property is the level of tooling to build each type of unit.
  1303. Defaults to @code{0} for each unit type.
  1304. @end deffn
  1305.  
  1306. @deffn UnitProperty @code{in} n
  1307. This property is the id of the unit's transport.
  1308. Defaults to @code{0}, meaning that unit is not in any transport.
  1309. @end deffn
  1310.  
  1311. @deffn UnitProperty @code{feelings} side-value-list@dots{}
  1312. This property is the unit's true feelings towards each side,
  1313. including its own side.
  1314. Defaults to @code{0} for each side.
  1315. @end deffn
  1316.  
  1317. @deffn UnitProperty @code{x} obj
  1318. This property is the optional extension properties of the unit.
  1319. Its value may be any object.
  1320. Defaults to @code{()}.
  1321. @end deffn
  1322.  
  1323. @deffn Symbol @code{appear}
  1324. This is the extension property that indicates when and where a unit will appear
  1325. in the game.
  1326. @end deffn
  1327.  
  1328. @subsection Unit Action State
  1329.  
  1330. @deffn UnitProperty @code{act} subprops
  1331. This property specifies the current action state of the unit.
  1332. @end deffn
  1333.  
  1334. @deffn UnitActionStateProperty @code{acp} n
  1335. This property is the number of action points left to the unit for this turn.
  1336. Defaults to @code{0}.
  1337. @end deffn
  1338.  
  1339. @deffn UnitActionStateProperty @code{acp0} n
  1340. This property is the initial number of action points for this turn,
  1341. computed at the beginning of the turn.
  1342. Defaults to @code{0}.
  1343. @end deffn
  1344.  
  1345. @deffn UnitActionStateProperty @code{aa} n
  1346. This property is the actual number of actions executed by the
  1347. unit so far in the current turn.
  1348. Defaults to @code{0}.
  1349. @end deffn
  1350.  
  1351. @deffn UnitActionStateProperty @code{am} n
  1352. This property is the actual number of moves (cell entries)
  1353. executed so far in the current turn.
  1354. Defaults to @code{0}.
  1355. @end deffn
  1356.  
  1357. @deffn UnitActionStateProperty @code{a} action
  1358. This property is the next action that the unit will perform.
  1359. @end deffn
  1360.  
  1361. Note that if any unit-defining form has an @code{act} property,
  1362. @i{Xconq} will start at an appropriate point in the middle of a turn,
  1363. giving all other units zero acp and mp,
  1364. rather than starting at the beginning of the turn
  1365. and computing acp and mp for all units.
  1366.  
  1367. @subsection Unit Plan
  1368.  
  1369. @deffn UnitProperty @code{plan} type [subtype] properties@dots{}
  1370. This property describes the unit's current plan.
  1371. @end deffn
  1372.  
  1373. @deffn PlanType @code{none}
  1374. A unit with this type of plan does nothing.
  1375. It is used when a side has no player.
  1376. [assume empty agenda, always asleep?]
  1377. @end deffn
  1378.  
  1379. @deffn PlanType @code{passive}
  1380. This plan type is for when the side is being run by a human
  1381. directly controlling all units.
  1382. @end deffn
  1383.  
  1384. @deffn PlanType @code{defensive}
  1385. @end deffn
  1386.  
  1387. @deffn PlanType @code{exploratory}
  1388. @end deffn
  1389.  
  1390. @deffn PlanType @code{offensive}
  1391. @end deffn
  1392.  
  1393. @deffn PlanType @code{random}
  1394. @end deffn
  1395.  
  1396. @deffn PlanProperty @code{goal}
  1397. This property is the main goal of a unit's plan.
  1398. @end deffn
  1399.  
  1400. The possible types of goals are these:
  1401.  
  1402. @deffn GoalType @code{won-game}
  1403. @end deffn
  1404.  
  1405. @deffn GoalType @code{lost-game}
  1406. @end deffn
  1407.  
  1408. @deffn GoalType @code{world-is-known}
  1409. @end deffn
  1410.  
  1411. @deffn GoalType @code{vicinity-is-known}
  1412. @end deffn
  1413.  
  1414. @deffn GoalType @code{positions-known}
  1415. @end deffn
  1416.  
  1417. @deffn GoalType @code{cell-is-occupied}
  1418. @end deffn
  1419.  
  1420. @deffn GoalType @code{vicinity-is-held}
  1421. @end deffn
  1422.  
  1423. @deffn GoalType @code{has-unit-type}
  1424. @end deffn
  1425.  
  1426. @deffn GoalType @code{has-unit-type-near}
  1427. @end deffn
  1428.  
  1429. @deffn GoalType @code{has-material-type}
  1430. @end deffn
  1431.  
  1432. [also support some kind of hook for specific AIs?]
  1433.  
  1434. @deffn PlanProperty @code{tasks} tasks@dots{}
  1435. This property is the complete task agenda for the unit's plan.
  1436. It is a list of tasks.
  1437. Defaults to @code{()}.
  1438. @end deffn
  1439.  
  1440. @deffn TaskType @code{approach}
  1441. @end deffn
  1442.  
  1443. @deffn TaskType @code{ask-side}
  1444. @end deffn
  1445.  
  1446. @deffn TaskType @code{build} u n n2 unit-id
  1447. @end deffn
  1448.  
  1449. @deffn TaskType @code{capture} unit-id
  1450. @end deffn
  1451.  
  1452. @deffn TaskType @code{do-action} action
  1453. @end deffn
  1454.  
  1455. @deffn TaskType @code{hit-position} x y z
  1456. @end deffn
  1457.  
  1458. @deffn TaskType @code{hit-unit} unit-id
  1459. @end deffn
  1460.  
  1461. @deffn TaskType @code{move-dir} dir
  1462. @end deffn
  1463.  
  1464. @deffn TaskType @code{move-to} x y z dist
  1465. @end deffn
  1466.  
  1467. @deffn TaskType @code{occupy} unit
  1468. @end deffn
  1469.  
  1470. @deffn TaskType @code{pickup} unit
  1471. @end deffn
  1472.  
  1473. @deffn TaskType @code{repair} unit
  1474. @end deffn
  1475.  
  1476. @deffn TaskType @code{resupply}
  1477. @end deffn
  1478.  
  1479. @deffn TaskType @code{sentry} n
  1480. @end deffn
  1481.  
  1482. @deffn PlanProperty @code{asleep}
  1483. This property is true if the unit is asleep.
  1484. Defaults to @code{false}.
  1485. @end deffn
  1486.  
  1487. @deffn PlanProperty @code{reserve}
  1488. This property is true if the unit is in reserve.
  1489. Defaults to @code{false}.
  1490. @end deffn
  1491.  
  1492. @deffn PlanProperty @code{wait}
  1493. This property is true if the unit is waiting for orders.
  1494. Defaults to @code{false}.
  1495. @end deffn
  1496.  
  1497. @section Agreements
  1498.  
  1499. @deffn Form @code{agreement} [name/id] properties@dots{}
  1500. This form defines an agreement among a set of sides.
  1501. The name/id is a unique internal identifier.
  1502. @end deffn
  1503.  
  1504. @deffn AgreementProperty @code{type-name} str
  1505. This property is the name of the general type of agreement,
  1506. such a trade.
  1507. Defaults to @code{""}.
  1508. @end deffn
  1509.  
  1510. @deffn AgreementProperty @code{title} str
  1511. This property is the player-visible name of the agreement.
  1512. Defaults to @code{""}.
  1513. @end deffn
  1514.  
  1515. @deffn AgreementProperty @code{terms} forms@dots{}
  1516. This property is the list of terms of the agreement.
  1517. Defaults to @code{()}.
  1518. @end deffn
  1519.  
  1520. @deffn AgreementProperty @code{proposer} side
  1521. This property is the side that initially proposed the agreement.
  1522. @end deffn
  1523.  
  1524. @deffn AgreementProperty @code{signers} sides-list
  1525. Before the agreement is made,
  1526. this property is the proposed list of participants.
  1527. After the agreeement is made,
  1528. this is the actual list of participants.
  1529. @end deffn
  1530.  
  1531. @deffn AgreementProperty @code{willing-to-sign} side-list
  1532. This property is all the sides that have already agreed to this agreement,
  1533. on condition that all the other sides accept it.
  1534. @end deffn
  1535.  
  1536. @deffn AgreementProperty @code{known-to} side-list
  1537. @end deffn
  1538.  
  1539. @deffn AgreementProperty @code{enforcement} form
  1540. @end deffn
  1541.  
  1542. [include values such as @code{enforced??} and @code{publicity??}]
  1543.  
  1544. @deffn AgreementProperty @code{active} t/f
  1545. This property is @code{true} if the agreement is actually in effect.
  1546. Defaults to @code{true}.
  1547. @end deffn
  1548.  
  1549. @node Scorekeepers, History Design, Unit Design, Game Design
  1550.  
  1551. @section Scorekeepers
  1552.  
  1553. Scorekeepers are the objects that manage scoring, winning, and losing.
  1554. A game design need not define any scorekeepers,
  1555. and none are created by default.
  1556. A scorekeeper may either maintain a numeric score that is used at
  1557. the end of the game to decide rankings, or simply declare a side
  1558. to have won or lost.
  1559.  
  1560. @deffn Form @code{scorekeeper} name properties@dots{}
  1561. This form creates or modifies a scorekeeper with the given @var{name},
  1562. with the given @var{properties}.
  1563. @end deffn
  1564.  
  1565. @deffn ScorekeeperProperty @code{title} str
  1566. This property is a string that identifies the scorekeeper to the players.
  1567. Defaults to @code{""}.
  1568. @end deffn
  1569.  
  1570. @deffn ScorekeeperProperty @code{when} (type [exp])
  1571. This property is when the scorekeeper will be checked or updated.
  1572. Defaults to @code{after-turn}.
  1573. @end deffn
  1574.  
  1575. @deffn SKSym @code{before-turn} exp
  1576. This symbol indicates that the scorekeeper will run at the start of each turn
  1577. matching @var{exp}, or after every turn if @var{exp} is not given.
  1578. @end deffn
  1579.  
  1580. @deffn SKSym @code{after-turn} exp
  1581. This symbol indicates that the scorekeeper will run at the end of each turn
  1582. matching @var{exp}, or after every turn if @var{exp} is not given.
  1583. @end deffn
  1584.  
  1585. @deffn SKSym @code{after-event} exp
  1586. This symbol indicates that the scorekeeper will run after every event
  1587. matching @var{exp}, or after every event if @var{exp} is not given.
  1588. @end deffn
  1589.  
  1590. @deffn SKSym @code{after-action} exp
  1591. This symbol indicates that the scorekeeper will run at the end of each action
  1592. matching @var{exp}, or after every action if @var{exp} is not given.
  1593. @end deffn
  1594.  
  1595. @deffn ScorekeeperProperty @code{applies-to} side-list
  1596. This property is the set of sides or side classes
  1597. to which the scorekeeper applies.
  1598. Scorekeepers apply only to sides that are in the game.
  1599. Defaults to @code{side*}. 
  1600. @end deffn
  1601.  
  1602. @deffn ScorekeeperProperty @code{known-to} side-list
  1603. This property is the list of sides that know about this scorekeeper,
  1604. and can see the value of the score for each side that it applies to.
  1605. Defaults to @code{side*}. 
  1606. @end deffn
  1607.  
  1608. @deffn ScorekeeperProperty @code{trigger} form
  1609. This property is an expression that is true when it is time
  1610. to start checking the scorekeeper's main test.
  1611. Once a scorekeeper is triggered, it remains active.
  1612. Defaults to @code{false}.
  1613. @end deffn
  1614.  
  1615. @deffn ScorekeeperProperty @code{triggered} t/f
  1616. This property is true if the scorekeeper is currently triggered.
  1617. Defaults to @code{true}.
  1618. @end deffn
  1619.  
  1620. @deffn ScorekeeperProperty @code{do} forms@dots{}
  1621. This property is a list of forms to execute in order
  1622. each time the scorekeeper runs.
  1623. Defaults to @code{()}.
  1624. @end deffn
  1625.  
  1626. @deffn ScorekeeperProperty @code{initial} value
  1627. This property is the value of the score upon game startup.
  1628. If this value is @code{-9999},
  1629. the scorekeeper does not maintain a numeric score.
  1630. Defaults to @code{-9999}.
  1631. @end deffn
  1632.  
  1633. @subsection Bodies
  1634.  
  1635. The forms in the body (the @code{do} property) of the scorekeeper
  1636. may be any of the forms listed here.
  1637.  
  1638. @deffn SKSym @code{last-side-wins}
  1639. If supplied as the only symbol in the body, then the scorekeeper
  1640. implements the usual ``last side left in the game wins'' behavior.
  1641. @end deffn
  1642.  
  1643. @deffn SKSym @code{if} test action
  1644. If the @i{test} evaluates to @code{true} or any nonzero number,
  1645. then the @i{action} will be done.
  1646. @end deffn
  1647.  
  1648. @deffn SKSym @code{cond} (test actions@dots{}) @dots{}
  1649. This is like Lisp's cond.
  1650. @end deffn
  1651.  
  1652. @deffn SKAct @code{stop} [message]
  1653. This stops the game immediately, with a draw for all sides.
  1654. @end deffn
  1655.  
  1656. @deffn SKAct @code{win} [sides] [own-message] [other-message]
  1657. @end deffn
  1658.  
  1659. @deffn SKAct @code{lose} [sides] [own-message] [other-message]
  1660. @end deffn
  1661.  
  1662. @deffn SKAct @code{end} [message]
  1663. This scorekeeper action ends the game immediately.
  1664. @end deffn
  1665.  
  1666. @deffn SKAct @code{add} exp [side]
  1667. This adds the result of evaluating @var{exp} to the score of the given side.
  1668. The value may be a negative number.
  1669. @end deffn
  1670.  
  1671. @subsection Functions
  1672.  
  1673. @deffn SKSym @code{and} exps
  1674. @end deffn
  1675.  
  1676. @deffn SKSym @code{or} exps
  1677. @end deffn
  1678.  
  1679. @deffn SKSym @code{not} exp
  1680. @end deffn
  1681.  
  1682. @deffn SKSym @code{=} exp1 exp2
  1683. @end deffn
  1684.  
  1685. @deffn SKSym @code{/=} exp1 exp2
  1686. @end deffn
  1687.  
  1688. @deffn SKSym @code{>} exp1 exp2
  1689. @end deffn
  1690.  
  1691. @deffn SKSym @code{>=} exp1 exp2
  1692. @end deffn
  1693.  
  1694. @deffn SKSym @code{<} exp1 exp2
  1695. @end deffn
  1696.  
  1697. @deffn SKSym @code{<=} exp1 exp2
  1698. @end deffn
  1699.  
  1700. @deffn SKSym @code{sum} types properties [test]
  1701. @end deffn
  1702.  
  1703. @subsection Scorefile
  1704.  
  1705. @deffn GlobalVariable @code{scorefile-name} str
  1706. @end deffn
  1707.  
  1708. @c [scorefile must include xconq version, module(s) plus versions,
  1709. @c player/side setup, dates/times, and list of scores/values plus
  1710. @c optional id as to which is which]
  1711.  
  1712. @node History Design, Battle States, Scorekeeper Design, Game Design
  1713.  
  1714. @section The History
  1715.  
  1716. All the important events in a game are logged into a history.
  1717.  
  1718. @deffn Form @code{evt} [date] type data
  1719. This form creates a single historical event.
  1720. If @i{date} is omitted, then the date will be the
  1721. same turn as for the last event read.
  1722. @end deffn
  1723.  
  1724. @deffn EventType @code{log-started}
  1725. @end deffn
  1726.  
  1727. @deffn EventType @code{game-started}
  1728. @end deffn
  1729.  
  1730. @deffn EventType @code{side-joined}
  1731. @end deffn
  1732.  
  1733. @deffn EventType @code{side-lost}
  1734. @end deffn
  1735.  
  1736. @deffn EventType @code{side-withdrew}
  1737. @end deffn
  1738.  
  1739. @deffn EventType @code{side-won}
  1740. @end deffn
  1741.  
  1742. @deffn EventType @code{unit-started-with}
  1743. @end deffn
  1744.  
  1745. @deffn EventType @code{unit-created}
  1746. @end deffn
  1747.  
  1748. @deffn EventType @code{unit-completed}
  1749. @end deffn
  1750.  
  1751. @deffn EventType @code{unit-acquired}
  1752. @end deffn
  1753.  
  1754. @deffn EventType @code{unit-captured}
  1755. @end deffn
  1756.  
  1757. @deffn EventType @code{unit-moved}
  1758. @end deffn
  1759.  
  1760. @deffn EventType @code{unit-assaulted}
  1761. @end deffn
  1762.  
  1763. @deffn EventType @code{unit-damaged}
  1764. @end deffn
  1765.  
  1766. @deffn EventType @code{unit-killed}
  1767. @end deffn
  1768.  
  1769. @deffn EventType @code{unit-vanished}
  1770. @end deffn
  1771.  
  1772. @deffn EventType @code{unit-wrecked}
  1773. @end deffn
  1774.  
  1775. @deffn EventType @code{unit-garrisoned}
  1776. @end deffn
  1777.  
  1778. @deffn EventType @code{unit-disbanded}
  1779. @end deffn
  1780.  
  1781. @deffn EventType @code{unit-starved}
  1782. @end deffn
  1783.  
  1784. @deffn EventType @code{unit-left-world}
  1785. @end deffn
  1786.  
  1787. @deffn EventType @code{game-ended}
  1788. @end deffn
  1789.  
  1790. @deffn EventType @code{log-ended}
  1791. @end deffn
  1792.  
  1793. @deffn EventType @code{action-ok}
  1794. @end deffn
  1795.  
  1796. @deffn EventType @code{action-error}
  1797. @end deffn
  1798.  
  1799. @deffn EventType @code{cannot-do}
  1800. @end deffn
  1801.  
  1802. @deffn EventType @code{insufficient-acp}
  1803. @end deffn
  1804.  
  1805. @deffn EventType @code{insufficient-material}
  1806. @end deffn
  1807.  
  1808. @deffn EventType @code{not-implemented-yet}
  1809. @end deffn
  1810.  
  1811. @deffn EventType @code{action-done}
  1812. @end deffn
  1813.  
  1814. @deffn EventType @code{move-error}
  1815. @end deffn
  1816.  
  1817. @c should flush this one
  1818. @deffn EventType @code{insufficient-mp}
  1819. @end deffn
  1820.  
  1821. @deffn EventType @code{cannot-leave-world}
  1822. @end deffn
  1823.  
  1824. @deffn EventType @code{destination-too-far}
  1825. @end deffn
  1826.  
  1827. @deffn EventType @code{destination-full}
  1828. @end deffn
  1829.  
  1830. @deffn EventType @code{overrun-failed}
  1831. @end deffn
  1832.  
  1833. @deffn EventType @code{overrun-failed}
  1834. @end deffn
  1835.  
  1836. @deffn EventType @code{fire-into-outside-world}
  1837. @end deffn
  1838.  
  1839. @deffn EventType @code{fire-into-too-far}
  1840. @end deffn
  1841.  
  1842. @deffn EventType @code{fire-at-too-far}
  1843. @end deffn
  1844.  
  1845. @deffn EventType @code{fire-into-too-near}
  1846. @end deffn
  1847.  
  1848. @deffn EventType @code{fire-at-too-near}
  1849. @end deffn
  1850.  
  1851. @deffn EventType @code{too-far}
  1852. @end deffn
  1853.  
  1854. @deffn EventType @code{too-near}
  1855. @end deffn
  1856.  
  1857. @node Battle States, , History Design, Game Design
  1858.  
  1859. @section Battle States
  1860.  
  1861. Battles always have exactly two ``sides'', referred to as A and B so
  1862. as not to confuse them with sides in the game.
  1863.  
  1864. @deffn Form @code{battle} a-list b-list@dots{}
  1865. @end deffn
  1866.  
  1867. Each list has the form
  1868. @example
  1869. ((<unit> <commitment>) ...)
  1870. @end example
  1871.  
  1872. @section Types in General
  1873.  
  1874. Types are the foundation of @i{Xconq} game designs.
  1875. Nearly all the rules and game parameters are associated
  1876. with the unit, material, and terrain types.
  1877. There is no sort of type hierarchy; instead, most forms allow sets of types
  1878. to be used in the place of single types.
  1879.  
  1880. Each type has an index associated with it, starting from 0.
  1881. This index never appears directly, and cannot be set.
  1882. This does mean that types have an order, so the order in which
  1883. types are defined is sometimes significant.
  1884. These cases will be noted.
  1885. The order is always the order in which the types appear in the file,
  1886. so it is always the same.
  1887.  
  1888. @subsection Naming
  1889.  
  1890. The names of types need not be distinct from each other,
  1891. but you run the risk of player confusion if they share names.
  1892.  
  1893. @deffn TypeProperty @code{name} string
  1894. This property is the specific name of the type.
  1895. This name will be displayed to players; the exact format
  1896. is up to the interface, but will typically
  1897. depend on the name's length and the space available in the display.
  1898. If no type names have been defined, the internal type name (see below)
  1899. will be used.
  1900. Defaults to @code{""}.
  1901. @end deffn
  1902.  
  1903. @deffn TypeProperty @code{long-name} string
  1904. This property is a fully spelled-out name for the type.
  1905. Defaults to @code{""}.
  1906. @end deffn
  1907.  
  1908. @deffn TypeProperty @code{short-name} string
  1909. This property is an abbreviated name of r
  1910. Defaults to @code{""}.
  1911. @end deffn
  1912.  
  1913. @deffn TypeProperty @code{generic-name} string
  1914. This property is like @code{name}, but identifies the type less specifically,
  1915. and several types may have the same generic name.
  1916. If no generic names are defined, then the regular type names will be used.
  1917. This is useful when making abbreviated lists, so that related types
  1918. get counted together.
  1919. Defaults to @code{()}.
  1920. @end deffn
  1921.  
  1922. As an example of the distinction between type names and generic type name,
  1923. the names of a automobile type might be @code{"1965 Mustang"},
  1924. @code{"Mustang"}, and @code{"M"},
  1925. while the generic name is @code{"auto"}.
  1926. Then the interface could choose to display a parking lot as containing
  1927. either @code{"4 auto"} or @code{"2 Mustang 1 Edsel 1 Jeep"}.
  1928.  
  1929. Note that names specified as properties are strings only, and are
  1930. not defined as evaluable symbols.
  1931.  
  1932. @subsection Imaging
  1933.  
  1934. The interpretation of these properties is entirely up to each interface;
  1935. see the appropriate interface documentation for details.
  1936.  
  1937. @deffn TypeProperty @code{image-name} str
  1938. This property is the name of the type's image.
  1939. If undefined or unusable for some reason,
  1940. the interface will display the type in some default manner, such as
  1941. a solid-color square or a string.
  1942. @end deffn
  1943.  
  1944. For example, in X11,
  1945. the name might be the name of a file in the usual bitmap format, as
  1946. produced by the @var{bitmap} program.  The actual file name is produced
  1947. by appending @code{".b"}.
  1948. (The situation in X is actually more complicated than this.)
  1949. See the interface documentation for details on how the interface
  1950. uses the image.
  1951.  
  1952. @deffn TypeProperty @code{color} str
  1953. This property is the name of the preferred color for this type.
  1954. Both normal color names and the strings @code{"bg"} and @code{"fg"}
  1955. (meaning ``foreground color'' and ``background color'')
  1956. may be used.
  1957. If the image is in color, then this property has no effect.
  1958. Defaults to @code{"fg"}.
  1959. @end deffn
  1960.  
  1961. @deffn TypeProperty @code{char} str
  1962. This property supplies a single character for this type
  1963. (all characters after the first one in @var{str} are ignored).
  1964. Defaults to @code{""}.
  1965. @end deffn
  1966.  
  1967. @subsection Documentation
  1968.  
  1969. @deffn TypeProperty @code{description} list@dots{}
  1970. This property is a list of lists describing different ways in which
  1971. an instance or instances of this type may be described textually.
  1972. This information may be used in narrative descriptions and by some
  1973. interfaces.
  1974. [describe syntax of the lists - are similar to name grammars]
  1975. If @code{()}, then the instance will be described in some default
  1976. fashion, such as (for units) @code{"the <side> <ordinal> <type>"}.
  1977. Defaults to @code{()}.
  1978. @end deffn
  1979.  
  1980. @deffn TypeProperty @code{help} string
  1981. This property is a brief (preferably one-line) description of the type.
  1982. Defaults to @code{""}.
  1983. @end deffn
  1984.  
  1985. @deffn TypeProperty @code{notes} strings@dots{}
  1986. This property is detailed documentation about the type. 
  1987. The formatting of the strings is up to the interface,
  1988. but in general each string is a separate line,
  1989. and the string @code{""} indicates a paragraph break.
  1990. Defaults to @code{()}.
  1991. @end deffn
  1992.  
  1993. @subsection Availability
  1994.  
  1995. It may be that a set of types is larger than strictly necessary for
  1996. a particular game.  You can make any type unavailable, which means
  1997. that irrespective of any other controls, that type cannot come into
  1998. play during a game.  You can also make it available only for particular
  1999. turns.
  2000.  
  2001. @deffn TypeProperty @code{available} n
  2002. If the value of this property is greater than 0, then this type is available
  2003. in the game on or after turn @var{n}.
  2004. If the value is less than 0, then the type is available,
  2005. but only until turn @var{-n}.
  2006. If the value is 0, then the type is never available.
  2007. Defaults to @code{1}, which means that the type is always available.
  2008. @end deffn
  2009.  
  2010. If a type becomes unavailable and there are units of that type in play,
  2011. then they will vanish immediately.
  2012.  
  2013. @subsection Type Extension
  2014.  
  2015. It may occasionally be necessary to add new kinds of
  2016. information to a type.
  2017. For instance, new synthesis methods may require special data,
  2018. or an interface may be able to use extra hints to improve its display.
  2019. The @code{extensions} property can be used to store this kind of data.
  2020.  
  2021. @deffn TypeProperty @code{extensions} properties@dots{}
  2022. This property is a catch-all for nonstandard type properties.
  2023. Anything may appear here, but it will only be interpreted as much as needed,
  2024. and unrecognized extensions will not be warned about (so if you misspell
  2025. one, you won't hear about it).
  2026. @end deffn
  2027.  
  2028. @node Unit Types, Command Chain, General, Type Definition
  2029.  
  2030. @section Unit Types
  2031.  
  2032. @deffn Form @code{unit-type} symbol properties@dots{}
  2033. This form defines a new type of unit.
  2034. The @var{symbol} is required and must be previously undefined.
  2035. The bindings in @var{properties} are then added to the type one by one.
  2036. If no other name properties are defined, the @var{symbol} may be displayed
  2037. to players (see above).
  2038. You can define no more than 126 types of units.
  2039. @end deffn
  2040.  
  2041. The @var{symbol} here becomes the unit type's ``internal type name''
  2042. which is guaranteed unique.
  2043. To make synonyms for the internal type name, use @code{define}.
  2044.  
  2045. @deffn GlobalVariable @code{u*}
  2046. This variable evaluates to a list of all unit types,
  2047. listed in the order that they were defined.
  2048. This list always reflects the list of types at the moment it is evaluated.
  2049. @end deffn
  2050.  
  2051. @deffn GlobalVariable @code{non-unit}
  2052. This variable [constant?] evaluates to a value that is NOT a unit type.
  2053. This is needed in several places to enable/disable features.
  2054. Use of this in any other way is an error,
  2055. and may or may not be detected before it causes a crash.
  2056. @end deffn
  2057.  
  2058. @subsection Unit Naming
  2059.  
  2060. @deffn UnitTypeProperty @code{namer} namer-id
  2061. This property is the namer that will be used to generate names for units,
  2062. if the unit's side does not have a namer, or the unit is
  2063. independent and not in any country.
  2064. Defaults to @code{0}, which leaves the unit unnamed.
  2065. @end deffn
  2066.  
  2067. @deffn UnitTypeProperty @code{assign-number} t/f
  2068. This property is true if the unit should have a serial number assigned to it
  2069. by the side it belongs to.
  2070. Serial numbers are maintained for each type on each side separately.
  2071. Defaults to @code{true}.
  2072. @end deffn
  2073.  
  2074. @subsection Class-Restricted Unit Types
  2075.  
  2076. Sometimes the designer will want to make different sides have different types
  2077. of units.  Although this can be done by setting up scenarios appropriately,
  2078. that won't close all the loopholes that might allow a side to get units that
  2079. should only ever belong to another side.
  2080.  
  2081. The first step is to define a class for each side.  For instance,
  2082. a side named @code{"Rome"} might have a class @code{"Roman"},
  2083. while the sides named @code{"Aedui"} and @code{"Parisii"}
  2084. could both be in the class @code{"barbarian"}.
  2085.  
  2086. @deffn UnitTypeProperty @code{possible-sides} exp
  2087. This property restricts the unit type to only be usable
  2088. by a side meeting the conditions of @var{exp}.
  2089. If @var{exp} is a string, it restricts the unit type to only
  2090. be usable by a side whose class includes a matching string.
  2091. This can also be a boolean combination.
  2092. Independent units belong to a side whose class is @code{"independent"}.
  2093. The default of @code{""} allows the unit to belong to any side.
  2094. @end deffn
  2095.  
  2096. @subsection Self-Units
  2097.  
  2098. The self-unit can be any type, including one that cannot act;
  2099. for instance, a capital city could be the self-unit, thus making
  2100. its defense all-important for a player.
  2101.  
  2102. @deffn GlobalVariable @code{self-required} t/f
  2103. This variable is true if each side is required to have a self-unit at all times.
  2104. Defaults to @code{false}.
  2105. [this should also have a related side property]
  2106. @end deffn
  2107.  
  2108. @deffn UnitTypeProperty @code{can-be-self} t/f
  2109. This property says that the type of unit can represent the side directly.
  2110. Defaults to @code{false}.
  2111. @end deffn
  2112.  
  2113. @deffn UnitTypeProperty @code{self-changeable} t/f
  2114. This property is true if the player can choose to change a self-unit of
  2115. this type at any time.
  2116. Otherwise the self-unit can be changed only if the current one dies.
  2117. Defaults to @code{false}.
  2118. @end deffn
  2119.  
  2120. @deffn UnitTypeProperty @code{self-resurrects} t/f
  2121. This property is true if when the self-unit dies, another unit of an allowable type
  2122. becomes the self-unit automatically.
  2123. Defaults to @code{false}.
  2124. @end deffn
  2125.  
  2126. Observe that these parameters can be used to develop various forms of
  2127. backup, so that a player can start out as a capital city, resurrect as
  2128. a town, change self to one of several towns, then lose when all the towns
  2129. are lost.
  2130.  
  2131. @deffn Table @code{control-chance-at} u1 u2 -> n%
  2132. @end deffn
  2133.  
  2134. @deffn Table @code{control-chance-adjacent} u1 u2 -> n%
  2135. @end deffn
  2136.  
  2137. @deffn Table @code{control-chance} u1 u2 -> n%
  2138. @end deffn
  2139.  
  2140. @deffn Table @code{control-distance-max} u1 u2 -> dist
  2141. This table gives the maximum distance from self-unit @var{u1}
  2142. at which units of type @var{u2}
  2143. can be controlled directly.  Units further away always act on their own
  2144. (as if the doctrine said so[?]).
  2145. If this value is < 0, then @var{u1} can never directly control
  2146. any other @var{u2} on the side.
  2147. Defaults to @code{infinity}.
  2148. @end deffn
  2149.  
  2150. @subsection Limiting Unit Quantities
  2151.  
  2152. The effect of these is
  2153. to prevent any extra units from being created or from going over to a
  2154. side, regardless of the reason.
  2155. This happens by either preventing player actions that would
  2156. result in exceeding a limit (such as when building units), or by making
  2157. the unit vanish instantly (such as when capturing a unit).
  2158.  
  2159. @deffn GlobalVariable @code{units-in-game-max} n
  2160. This variable is the maximum number of all types of units, on all sides,
  2161. including independents, that may exist at any time, including initially.
  2162. Defaults to @code{-1}, which means that there is no limit.
  2163. @end deffn
  2164.  
  2165. @deffn GlobalVariable @code{units-per-side-max} n
  2166. This variable is the maximum number of units (of all types together) 
  2167. that any side may have, at any time.  Events that would cause
  2168. the limit to be exceeded, such as capturing a unit, result in
  2169. either the unit vanishing or becoming independent.
  2170. Defaults to @code{-1}, which means that there is no limit.
  2171. @end deffn
  2172.  
  2173. There is no limit on the number of units that may be independent.
  2174.  
  2175. @deffn UnitTypeProperty @code{type-in-game-max} n
  2176. This property is the maximum total of the given type, for all sides together.
  2177. Defaults to @code{-1}, which means that there is no limit.
  2178. @end deffn
  2179.  
  2180. @deffn UnitTypeProperty @code{type-per-side-max} n
  2181. This property is the maximum number of units of the given type allowed to each side.
  2182. Defaults to @code{-1}, which means that there is no limit.
  2183. @end deffn
  2184.   
  2185. @subsection Hit Points
  2186.  
  2187. A unit's hit points determine how healthy it is.
  2188. If a unit's hp goes below 1, it is either @dfn{wrecked},
  2189. meaning that it changes to a new type
  2190. @code{wrecked-type} or else it @dfn{vanishes},
  2191. meaning that it is completely cleared from the world.
  2192.  
  2193. @deffn UnitTypeProperty @code{hp-max} n
  2194. This property is the maximum number of hit points for (each part of) a unit.
  2195. Completed units start with this many hit points.
  2196. Defaults to @code{1}.
  2197. @end deffn
  2198.  
  2199. @deffn UnitTypeProperty @code{parts-max} n
  2200. This property declares that a unit is to be treated
  2201. as an aggregate of @var{n} smaller identical units.
  2202. Defaults to @code{1}.
  2203. @end deffn
  2204.  
  2205. @deffn UnitTypeProperty @code{wrecked-type} unit-type
  2206. This property is the type of unit that a unit with 0 hp will become.
  2207. For instance, a destroyed ``fort'' might become a ``rubble pile'' unit.
  2208. If its value is @code{non-unit}, then the destroyed unit just vanishes.
  2209. The @code{wrecked-type} of a type must be a different type.
  2210. Defaults to @code{non-unit}.
  2211. @end deffn
  2212.  
  2213. The transformation to the wrecked type does not change position or name.
  2214. The transformed unit has full hp, supplies are conserved as much as possible,
  2215. tooling is preserved, and any unit plan is erased.
  2216. It has the same number of parts, or as many as possible if that is fewer.
  2217. It may be that the
  2218. wrecked type is on terrain that it cannot survive on; in that case, it
  2219. will be wrecked again, repeating until the unit either vanishes
  2220. or is in a viable position, or this process has been repeated
  2221. more times than the number of unit types (prevents infinite loops).
  2222. Any excess occupants will be removed and either placed in another nearby
  2223. unit or in the open, or will vanish if there is no other option.
  2224.  
  2225. @deffn UnitTypeProperty @code{hp-recovery} n
  2226. This property is the number of 1/100 hp recovered per turn.
  2227. Recovery happens automatically, as opposed to repair,
  2228. which requires explicit action.
  2229. The amount @i{n} / 100 is recovered automatically each turn,
  2230. while @i{n} mod 100 is the percent chance of recovering 1 hit point
  2231. in addition.
  2232. Defaults to @code{0}.
  2233. @end deffn
  2234.  
  2235. @subsection Experience
  2236.  
  2237. @deffn UnitTypeProperty @code{cxp-max} cxp
  2238. This property is the maximum combat experience this type of unit can have.
  2239. Defaults to @code{0}.
  2240. @end deffn
  2241.  
  2242. @subsection Tech Levels
  2243.  
  2244. Before it can do anything with a type of unit,
  2245. the side must have the appropriate tech level for that type,
  2246. which is just a number ranging from 0 up to @code{tech-level-max}.
  2247. Each type has a distinct tech level.
  2248.  
  2249. Tech levels always increase
  2250. (since they represent abstract knowledge rather than physical plant).
  2251. Tech can be transferred freely to any other side
  2252. via the message @code{tech} [xref to messages].
  2253.  
  2254. For each unit type, the following parameters define the minimum tech levels at
  2255. which sides can do various things.
  2256.  
  2257. @deffn UnitTypeProperty @code{tech-to-see} tl
  2258. This property is the minimum tech level that a side must have before it can see
  2259. a unit of this type.
  2260. Defaults to @code{0}.
  2261. @end deffn
  2262.  
  2263. @deffn UnitTypeProperty @code{tech-to-use} tl
  2264. This property is the minimum tech level that a side must have in order to use
  2265. this type of unit.
  2266. Defaults to @code{0}.
  2267. @end deffn
  2268.  
  2269. @deffn UnitTypeProperty @code{tech-to-dissect} tl
  2270. This property is the minimum tech level
  2271. that a side must have in order to dissect
  2272. this type of unit and thereby increase its tech level.
  2273. Defaults to @code{0}.
  2274. @end deffn
  2275.  
  2276. @deffn UnitTypeProperty @code{tech-from-dissection} tl
  2277. This property is the tech level that may be reached
  2278. by acquiring a unit of this type.
  2279. Since this is expressed as a minimum,
  2280. repeated acquisitions have no additional effect.
  2281. Defaults to @code{0}.
  2282. @end deffn
  2283.  
  2284. @deffn UnitTypeProperty @code{tech-to-build} tl
  2285. This property is the minimum tech level that a side
  2286. must have in order to build this type of unit.
  2287. Defaults to @code{0}.
  2288. @end deffn
  2289.  
  2290. @deffn UnitTypeProperty @code{tech-max} tl
  2291. This property is the absolute maximum tech level possible for this type.
  2292. Defaults to @code{0}.
  2293. @end deffn
  2294.  
  2295. @deffn Table @code{tech-crossover} u1 u2 -> n%
  2296. This table is the minimum tech level for @var{u2} that is guaranteed by a particular
  2297. tech level for @var{u1}, expressed as a percentage of the @code{tech-max}
  2298. for the types.
  2299. For instance, if @code{tech-crossover} is 80, and the tech level for @var{u1}
  2300. is 10 out of a max of 20, and the max for @var{u2} is also 20,
  2301. then the side has a tech for @var{u2} at least 8.
  2302. Defaults to @code{0}.
  2303. @end deffn
  2304.  
  2305. It is possible to gain some tech level just by being in the same game
  2306. with a side that is more advanced.
  2307.  
  2308. @deffn UnitTypeProperty @code{tech-leakage} .01tl
  2309. This property is the amount of tech level gain per turn that can happen
  2310. to any side's tech level that is less than the max of all sides in the game.
  2311. This only happens if at least one unit on the side has nonzero coverage
  2312. of a unit on a more advanced side.
  2313. Defaults to @code{0}.
  2314. @end deffn
  2315.  
  2316. @subsection Feelings and Attitudes
  2317.  
  2318. @deffn UnitTypeProperty @code{attitudes-max} n
  2319. This property is the number of different sides that a unit can
  2320. have feelings about.
  2321. Defaults to @code{0}.
  2322. @end deffn
  2323.  
  2324. @subsection Chain of Command
  2325.  
  2326. Some types of units can give orders to other units.
  2327.  
  2328. @deffn Table @code{can-command} u1 u2 -> t/f
  2329. @end deffn
  2330.  
  2331. [how does this work with control model?]
  2332.  
  2333. @subsection Point Value
  2334.  
  2335. Point values provide an abstract way to characterize the overall importance
  2336. of a unit type.
  2337. Point values figure into some scorekeepers, and are used by AIs.
  2338.  
  2339. @deffn UnitTypeProperty @code{point-value} n
  2340. This property is the ``value'' of a unit.
  2341. Defaults to @code{1}.
  2342. @end deffn
  2343.  
  2344. @node Terrain Types, Material Types, Point Value, Type Definition
  2345.  
  2346. @section Terrain Types
  2347.  
  2348. Terrain types are associated with the cells, borders,
  2349. connections, and coatings in a world.
  2350.  
  2351. @deffn Form @code{terrain-type} name properties@dots{}
  2352. This form defines a new type of terrain, named by @var{name}.
  2353. Details are similar to those for unit types.
  2354. @end deffn
  2355.  
  2356. @deffn GlobalVariable @code{t*}
  2357. This variable evaluates to a list of all terrain types,
  2358. listed in the order that they were defined.
  2359. @end deffn
  2360.  
  2361. @deffn GlobalVariable @code{non-terrain}
  2362. This variable has a value that is guaranteed not to be a terrain type.
  2363. @end deffn
  2364.  
  2365. @subsection Terrain Subtypes
  2366.  
  2367. Terrain can appear in four different roles: as the interior of
  2368. a cell, as a border between cells, as a connection between cells,
  2369. or as a coating overlaying the normal terrain.
  2370. The terrain subtype says which role a type can play.
  2371.  
  2372. @deffn TerrainTypeProperty @code{subtype} subtype
  2373. This property is the role that the terrain type can appear in.
  2374. Defaults to @code{cell}.
  2375. @end deffn
  2376.  
  2377. @deffn GlobalConstant @code{cell}
  2378. This constant indicates that terrain can fill a cell.
  2379. All units in the open and with an altitude of 0 are assumed
  2380. to be surrounded by the cell terrain.
  2381. @end deffn
  2382.  
  2383. @deffn GlobalConstant @code{border}
  2384. This constant indicates that the terrain can be a border.
  2385. @end deffn
  2386.  
  2387. @deffn GlobalConstant @code{connection}
  2388. This constant indicates that the terrain can be a connection.
  2389. @end deffn
  2390.  
  2391. @deffn GlobalConstant @code{coating}
  2392. This constant indicates that the terrain can be a coating.
  2393. A @dfn{coating} is a temporary terrain modification.
  2394. The classic example is snow,
  2395. which effectively changes some kinds of terrain,
  2396. but not completely and usually not permanently.
  2397. Cells can have varying heaviness of each type of coating.
  2398. @end deffn
  2399.  
  2400. @deffn Table @code{coating-depth-min} t1 t2 -> n
  2401. In order for a coating @var{t1} to ``stick'',
  2402. this table says much must be added all at once to terrain @var{t2}.
  2403. A coating depth that drops below this will disappear immediately.
  2404. Defaults to @code{0}.
  2405. @end deffn
  2406.  
  2407. @deffn Table @code{coating-depth-max} t1 t2 -> n
  2408. This table is the upper limit on coating depth.
  2409. Defaults to @code{0}.
  2410. @end deffn
  2411.  
  2412. Terrain types may have additional subtype attributes that
  2413. are used only during synthesis, to select appropriate subtypes
  2414. for special purposes.
  2415.  
  2416. @deffn TerrainTypeProperty @code{subtype-x} n
  2417. This property is extra subtype information, used in synthesis.
  2418. Defaults to @code{no-x}.
  2419. @end deffn
  2420.  
  2421. @deffn GlobalConstant @code{river-x}
  2422. This constant indicates that synthesis methods should treat this
  2423. type as a river.
  2424. The terrain type may be either a border or a connection.
  2425. @end deffn
  2426.  
  2427. @deffn GlobalConstant @code{valley-x}
  2428. This constant indicates that synthesis methods should treat this type
  2429. as a valley.
  2430. @end deffn
  2431.  
  2432. @deffn GlobalConstant @code{road-x}
  2433. This constant indicates that synthesis methods should treat this type
  2434. as a road.
  2435. @end deffn
  2436.  
  2437. @deffn TerrainTypeProperty @code{liquid} t/f
  2438. This property is true if the terrain type represents a liquid,
  2439. which means that
  2440. adjacent cells of liquid have the same elevation and so forth.
  2441. Defaults to @code{false}.
  2442. @end deffn
  2443.  
  2444. @subsection Terrain Compatibility
  2445.  
  2446. Terrain types are not always mutually compatible.
  2447.  
  2448. @deffn Table @code{adjacent-terrain-effect} t1 t2 -> t3
  2449. This table specifies what will happen to a cell of type @var{t1}
  2450. adjacent to a cell of type @var{t2}.  If @var{t3} is @code{non-terrain},
  2451. nothing will happen, otherwise it will become a cell of type @var{t3}.
  2452. Defaults to @code{non-terrain}.
  2453.  
  2454. t1 == t3 means no effect.
  2455.  
  2456. This also specifies what will happen to a border of type @var{t1}
  2457. adjacent to a cell of type @var{t2}.  If @var{t3} is @code{non-terrain},
  2458. then the border cannot border the cell, otherwise it
  2459. will become a border of type @var{t3} (or disappear if
  2460. @var{t3} cannot be a border).
  2461. Defaults to @code{non-terrain} [a problem, will erase borders usually]
  2462.  
  2463. This also specifies what will happen to a connection of type @var{t1}
  2464. in a cell of type @var{t2}.  If @var{t3} is @code{non-terrain},
  2465. then the connection cannot be in the cell, otherwise it
  2466. will become a connection of type @var{t3} (or disappear if
  2467. @var{t3} cannot be a connection).
  2468. Defaults to @code{non-terrain} [a problem, will erase connections usually]
  2469. @end deffn
  2470.  
  2471. @subsection Other Terrain Properties
  2472.  
  2473. @deffn TerrainTypeProperty @code{elevation-min} dist
  2474. @end deffn
  2475. @deffn TerrainTypeProperty @code{elevation-max} dist
  2476. These properties define the minimum and maximum possible values
  2477. for the elevation in a cell of given terrain type.
  2478. Both default to @code{0}.
  2479. @end deffn
  2480.  
  2481. @deffn TerrainTypeProperty @code{temperature-min} n
  2482. @end deffn
  2483. @deffn TerrainTypeProperty @code{temperature-max} n
  2484. These properties define the minimum and maximum possible values
  2485. for the temperature in a cell of given terrain type.
  2486. They default to @code{-50} and @code{50}.
  2487. @end deffn
  2488.  
  2489. @deffn TerrainTypeProperty @code{wind-force-min} n
  2490. @end deffn
  2491. @deffn TerrainTypeProperty @code{wind-force-max} n
  2492. @end deffn
  2493.  
  2494. @deffn TerrainTypeProperty @code{clouds-min} n
  2495. @end deffn
  2496. @deffn TerrainTypeProperty @code{clouds-max} n
  2497. @end deffn
  2498.  
  2499. @node Material Types, Type Relationships, Terrain Types, Type Definition
  2500.  
  2501. @section Material Types
  2502.  
  2503. Materials are materials that are manipulated in mass quantities.
  2504. In general, material types just index arrays of unit supplies.
  2505.  
  2506. Lots of different material types can be thoroughly confusing.
  2507. You should use as few as possible.
  2508. The maximum number of material types is 126.
  2509.  
  2510. @deffn Form @code{material-type} symbol properties@dots{}
  2511. This form defines a new type of material, named by @var{symbol}.
  2512. Details are similar to those for unit types.
  2513. @end deffn
  2514.  
  2515. @deffn GlobalVariable @code{m*}
  2516. This variable evaluates to a list of all material types,
  2517. listed in the same order as they were defined.
  2518. @end deffn
  2519.  
  2520. @deffn GlobalVariable @code{non-material}
  2521. This variable has a value that is never a material type.
  2522. @end deffn
  2523.  
  2524. @subsection People
  2525.  
  2526. A material type can be designated as representing people.
  2527.  
  2528. @deffn MaterialTypeProperty @code{people} n
  2529. This property is the actual number of individuals
  2530. represented by 1 of a material.
  2531. If 0, then the material type does not have people associated with it at all.
  2532. Defaults to @code{0}.
  2533. @end deffn
  2534.  
  2535. Multiple types of materials can represent different types of people,
  2536. so for example you could have one type @code{nomad} with 10 people/material,
  2537. and another type @code{urbanite} with 10,000 people/material.
  2538.  
  2539. The basic cell capacities for materials also constrains people
  2540. materials, also there is a limit on the number of individuals.
  2541.  
  2542. @deffn TerrainTypeProperty @code{people-max} n
  2543. This property is the maximum number of individuals allowed
  2544. in a cell of this type of terrain.
  2545. This is checked at the end of each turn;
  2546. any excess will be moved into adjacent cells or disappear entirely.
  2547. Defaults to @code{-1}, which allows any number of people in a cell.
  2548. @end deffn
  2549.  
  2550. @node Type Relationships, Hints, Material Types, Type Definition
  2551.  
  2552. @section Static Relationships Between Types
  2553.  
  2554. In general, static relationships are those that must always hold
  2555. during a turn.  @i{Xconq} will usually only test these when
  2556. necessary, but the code is free to do so more often.
  2557.  
  2558. @subsection Occupants and Transports
  2559.  
  2560. A unit inside another unit is an ``occupant'' in a ``transport'',
  2561. even if the ``transport'' can never move.
  2562. There are two kinds of capacity.  Generic capacity is shared by
  2563. all different types, while guaranteed capacity is for a particular
  2564. type only.
  2565.  
  2566. @deffn UnitTypeProperty @code{capacity} n
  2567. This property is the limit on the sum of sizes of units that may occupy this
  2568. type of unit, not counting the exclusive capacities.
  2569. Defaults to @code{0}.
  2570. @end deffn
  2571.  
  2572. @deffn Table @code{unit-size-as-occupant} u1 u2 -> n
  2573. This table is the ``size'' of a (full-sized) unit @var{u1} when it is in
  2574. a transport @var{u2}.
  2575. Defaults to @code{1}.
  2576. @end deffn
  2577.  
  2578. @deffn Table @code{unit-capacity-x} u1 u2 -> n
  2579. This table is the number of units of type @var{u2} that are guaranteed
  2580. a place in a unit of type @var{u1}.
  2581. Defaults to @code{0}.
  2582. @end deffn
  2583.  
  2584. @deffn Table @code{occupant-max} u1 u2 -> n
  2585. This table is the upper limit on the number of occupants of this type
  2586. (not counting @code{unit-capacity-x}).
  2587. Defaults to @code{0}.
  2588. @end deffn
  2589.  
  2590. @deffn UnitTypeProperty @code{occupant-total-max} n
  2591. This property is the upper limit on occupants of all types together.
  2592. Defaults to @code{-1}, which allows unlimited occupancy.
  2593. @end deffn
  2594.  
  2595. A unit that is an occupant may not always have the same capabilities
  2596. as when it is out in the open.
  2597.  
  2598. @deffn Table @code{occupant-vision} u1 u2 -> n%
  2599. This table is the quality of @var{u1}'s vision while an occupant of @var{u2},
  2600. expressed as a percentage of normal coverage.
  2601. Defaults to @code{100}.
  2602. @end deffn
  2603.  
  2604. @deffn Table @code{occupant-combat} u1 u2 -> n%
  2605. This table is @code{true} if @var{u1} do any combat action
  2606. while an occupant of @var{u2}.
  2607. Defaults to @code{100}.
  2608. @end deffn
  2609.  
  2610. @deffn Table @code{occupant-can-construct} u1 u2 -> t/f
  2611. This table is @code{true} if @var{u1} can build things while an occupant of @var{u2}.
  2612. Defaults to @code{0}.
  2613. @end deffn
  2614.  
  2615. @deffn Table @code{occupant-can-have-occupants} u1 u2 -> t/f
  2616. This table is @code{true} if @var{u1} can have occupants of its own
  2617. while an occupant of @var{u2}.
  2618. Defaults to @code{false}.
  2619. @end deffn
  2620.  
  2621. @subsection Units and Terrain
  2622.  
  2623. @deffn Table @code{vanishes-on} u t -> t/f
  2624. This table is @code{true} if a unit @var{u} will disappear instantly if it
  2625. somehow ends up on terrain of type @var{t}.
  2626. Defaults to @code{false}.
  2627. @end deffn
  2628.  
  2629. @deffn Table @code{wrecks-on} u t -> t/f
  2630. This table is @code{true} if a unit @var{u} will wreck instantly if it
  2631. somehow ends up on terrain of type @var{t}.
  2632. Defaults to @code{false}.
  2633. @end deffn
  2634.  
  2635. @deffn TerrainTypeProperty @code{capacity} n
  2636. This property is the limit on the sum of unit sizes that may share this cell.
  2637. Defaults to @code{1}.
  2638. @end deffn
  2639.  
  2640. @deffn Table @code{unit-size-in-terrain} u t -> n
  2641. This table is the ``size'' of a (full-sized) unit @var{u} when it is
  2642. in/on the terrain @var{t}.
  2643. Defaults to @code{1}.
  2644. @end deffn
  2645.  
  2646. @deffn Table @code{terrain-capacity-x} u t -> n
  2647. This table is the number of (full-sized) units of type @var{u}
  2648. that are guaranteed to have a place in the cell.
  2649. Defaults to @code{0}.
  2650. @end deffn
  2651.  
  2652. Note that the units' sides are irrelevant;
  2653. the sizes of units of all sides are added together.
  2654. Limits are calculated separately for the connection and open terrain
  2655. in a cell, but some unit types negate the capacity of connections.
  2656.  
  2657. @deffn Table @code{capacity-negation} u t -> t/f
  2658. This table is @code{true} if when @var{u} is in the open in a cell
  2659. that includes connections of type @var{t},
  2660. those connections have no capacity for units.
  2661. Defaults to @code{false}.
  2662. @end deffn
  2663.  
  2664. @deffn UnitTypeProperty @code{stack-order} n
  2665. This property is the relative position of this type of unit within a stack of
  2666. different units.
  2667. Larger values put units higher in the stack.
  2668. The exact values are unimportant, they are just used as sort keys.
  2669. The use of this value is to ensure that particular types are ``seen first''
  2670. when looking at a cell, so for instance if a truck and a city are stacked
  2671. on the same cell, everybody will see the city and not the truck.
  2672. The owner of these units can still see them.
  2673. If the stack-order of two units is the same,
  2674. then the higher-numbered type will be higher in the stack.
  2675. Defaults to @code{0}.
  2676. @end deffn
  2677.  
  2678. There is a possible bizarrity with stacking limits and units that can't
  2679. see each other when in the same hex, namely that a player could be prevented
  2680. from moving a unit into a cell that looks like it has enough room.
  2681.  
  2682. @subsection Units and Materials
  2683.  
  2684. Units can carry materials.  As with occupants, there is
  2685. both a generic storage space and spaces specialized for
  2686. each material type.
  2687.  
  2688. @deffn UnitTypeProperty @code{storage} n
  2689. This property is a unit's generic space for materials of any type.
  2690. Defaults to @code{0}.
  2691. @end deffn
  2692.  
  2693. @deffn Table @code{material-size-in-unit} u m -> n
  2694. This table is the amount by which the given material counts against
  2695. the unit's storage space.
  2696. Defaults to @code{1}.
  2697. @end deffn
  2698.  
  2699. @deffn Table @code{unit-storage-x} u m -> n
  2700. This table is the space reserved specifically for each
  2701. type of material.
  2702. Defaults to @code{0}.
  2703. @end deffn
  2704.  
  2705. Materials that represent people can damage units and/or
  2706. surrender to them.
  2707.  
  2708. @deffn Table @code{people-sabotage-rate??} u m -> .01hp
  2709. This table is the attrition rate of a unit in the open in
  2710. a cell with people on a hostile [define] side.
  2711. @end deffn
  2712.  
  2713. @deffn Table @code{people-surrender-chance} u m -> n%
  2714. This table is the chance that people of type @var{m} will change sides
  2715. if a unit of type @var{u} is in their cell.
  2716. Defaults to @code{0}.
  2717. @end deffn
  2718.  
  2719. @subsection Terrain and Materials
  2720.  
  2721. @deffn Table @code{terrain-storage-x} t m -> n
  2722. This table is the amount of a material @var{m} that can be accumulated in a cell
  2723. with terrain @var{t}.
  2724. Defaults to @code{0}.
  2725. @end deffn
  2726.  
  2727. @deffn Table @code{material-size-in-terrain} t m -> n
  2728. @end deffn
  2729.  
  2730. @section Vision
  2731.  
  2732. Each unit can have two kinds of vision; @dfn{generic vision}
  2733. or just @dfn{vision} that
  2734. represents an aggregate of actual vision, circumstantial evidence,
  2735. and whatever else, and @dfn{specialized vision} that works similarly,
  2736. but can be given different characteristics.
  2737. Also, units can spy on each other.
  2738.  
  2739. Both generic and specialized vision generate a ``coverage'' for
  2740. each cell.  Coverage of zero means nobody is observing the cell,
  2741. and it may go arbitrarily high.
  2742. When a unit is sufficiently well-covered and has been seen,
  2743. then it is ``under observation'', which means that view data
  2744. will always be current.
  2745.  
  2746. @deffn GlobalVariable @code{see-all} t/f
  2747. This variable is @code{true} if everything in the world, units, terrain, etc,
  2748. is always visible at all times, including initially.
  2749. It takes precedence over @i{all} other visibility and spying parameters.
  2750. Defaults to @code{false}.
  2751. @end deffn
  2752.  
  2753. @deffn GlobalVariable @code{see-terrain-always} t/f
  2754. If this variable is @code{true}, then any side that has seen the terrain of a cell
  2755. will be informed if that terrain ever changes.
  2756. Defaults to @code{true}.
  2757. @end deffn
  2758.  
  2759. @deffn GlobalVariable @code{see-weather-always} t/f
  2760. @end deffn
  2761.  
  2762. @deffn UnitTypeProperty @code{see-always} t/f
  2763. This property is @code{true} when a unit is always visible
  2764. after it has been seen once,
  2765. so that side changes, movements, etc will be seen forever afterwards.
  2766. If the unit moves into terrain that has not been seen,
  2767. then that terrain also becomes seen as well.
  2768. Defaults to @code{false}.
  2769. @end deffn
  2770.  
  2771. @deffn UnitTypeProperty @code{see-occupants} t/f
  2772. This property is @code{true} when a unit's occupants are also seen
  2773. whenever the unit itself is under observation.
  2774. Defaults to @code{false}.
  2775. @end deffn
  2776.  
  2777. @deffn UnitTypeProperty @code{see-action} t/f
  2778. If this property is @code{true},
  2779. then the unit's chance to be seen by other sides will be
  2780. tested each time the unit acts in any way.
  2781. This property is in addition to the check at the beginning of each turn.
  2782. Defaults to @code{true}.
  2783. @end deffn
  2784.  
  2785. @deffn UnitTypeProperty @code{see-movement} t/f
  2786. If this property is @code{true},
  2787. then the unit's chance to be seen by other sides will be
  2788. tested each time the unit moves.
  2789. @code{see-action} implies @code{see-movement}.
  2790. Defaults to @code{true}.
  2791. @end deffn
  2792.  
  2793. @deffn UnitTypeProperty @code{see-combat} t/f
  2794. @end deffn
  2795.  
  2796. The people in a cell effectively view (for their side)
  2797. all units in that cell.
  2798. Some units can hide from the people.
  2799.  
  2800. @deffn Table @code{visibility-to-people} u m -> n%
  2801. This table is the chance that the people of the
  2802. given type @var{m} will see a unit of type @var{u}.
  2803. This will be evaluated for each people type individually,
  2804. once at the beginning of each turn, and once for each populated cell
  2805. that the unit enters during the turn.
  2806. Defaults to @code{100}.
  2807. @end deffn
  2808.  
  2809. @deffn TerrainTypeProperty @code{thickness} dist
  2810. This property is the thickness of the terrain, which is the difference between
  2811. the ``ground'' of the terrain and its top.
  2812. (See vision parameters for the effects of terrain thickness.)
  2813. Defaults to @code{0}.
  2814. @end deffn
  2815.  
  2816. @deffn UnitTypeProperty @code{weather-vision-range} dist
  2817. [should be a table so can't see a long ways off from within forest?]
  2818. @end deffn
  2819.  
  2820. @subsection Generic Vision
  2821.  
  2822. @deffn UnitTypeProperty @code{vision-range} dist
  2823. This property is the maximum range of vision coverage by the unit.
  2824. A value of @code{-1} disables all vision,
  2825. @code{0} means only units in the same cell may be seen,
  2826. and @code{1} means units in adjacent cells may be seen.
  2827. Defaults to @code{1}.
  2828. @end deffn
  2829.  
  2830. @deffn UnitTypeProperty @code{vision-bend} n
  2831. This property is the amount by which a unit can see ``around corners''.
  2832. 0 means that vision is strictly line-of-sight,
  2833. while 100 means that elevations never obstruct vision.
  2834. Defaults to @code{100}.
  2835. @end deffn
  2836.  
  2837. @deffn UnitTypeProperty @code{vision-at} n
  2838. @end deffn
  2839. @deffn UnitTypeProperty @code{vision-adjacent} n
  2840. @end deffn
  2841. @deffn UnitTypeProperty @code{vision-at-max-range} n
  2842. Each of these properties represents the amount of vision coverage provided
  2843. by the unit type at various ranges.
  2844. All default to @code{1}.
  2845. @end deffn
  2846.  
  2847. @deffn Table @code{visibility} u t -> n%
  2848. This table is the basic chance to see a unit of type @var{u} when
  2849. in terrain of type @var{t},
  2850. expressed as a percentage of the coverage by the viewing side.
  2851. Defaults to @code{100}.
  2852. @end deffn
  2853.  
  2854. @deffn Table @code{combat-visibility} u1 u2 -> n%
  2855. This table is the basic chance to see a unit of type @var{u1} when
  2856. in combat with a unit of type @var{u2},
  2857. expressed as a percentage of the coverage by the viewing side.
  2858. This is evaluated for each combat action within a turn.
  2859. Defaults to @code{100}.
  2860. @end deffn
  2861.  
  2862. @deffn UnitTypeProperty @code{lockon-chance} n%
  2863. This property is the chance that once seen, a unit will continue to be seen
  2864. while it is being covered.
  2865. This is effectively true for any unit
  2866. with a @code{visibility} of @code{100}.
  2867. Defaults to @code{0}.
  2868. @end deffn
  2869.  
  2870. @deffn Table @code{eye-height} u t -> dist
  2871. This propety is the additional elevation above the unit's position that a unit
  2872. can see with, when in the given terrain.
  2873. Defaults to @code{0}.
  2874. @end deffn
  2875.  
  2876. @subsection Spying
  2877.  
  2878. A unit type can also be specified to do spying automatically.
  2879. The outcome of spying is calculated once/unit/turn,
  2880. at the beginning of the turn (after move calculation but before
  2881. any players can do anything).
  2882. Spying can happen to any unit not on the spying unit's side.
  2883.  
  2884. @deffn UnitTypeProperty @code{spy-chance} n.f%
  2885. This property is the chance that the unit's spies will find out something.
  2886. Defaults to @code{0}.
  2887. @end deffn
  2888.  
  2889. @deffn UnitTypeProperty @code{spy-range} dist
  2890. This property is the maximum distance at which the unit's spies will find out
  2891. something.
  2892. Defaults to @code{0}.
  2893. @end deffn
  2894.  
  2895. @deffn Table @code{spy-quality} u1 u2 -> n%
  2896. This table gives the chance that @var{u1}'s spies will return information
  2897. about a unit of type @var{u2}.
  2898. Defaults to @code{100}.
  2899. @end deffn
  2900.  
  2901. @deffn Table @code{compromise-chance} u1 u2 -> n%
  2902. This table is the chance that if @var{u1}'s spies return information
  2903. about a unit of type @var{u2}, then that unit will always be
  2904. visible thereafter, as if it were @code{see-always}.
  2905. The compromised unit and its side will not be aware that
  2906. this has happened.
  2907. Defaults to @code{0}.
  2908. @end deffn
  2909.  
  2910. @section Game Initialization and Naming
  2911.  
  2912. Game initialization always starts by resetting all the game-defining data
  2913. structures to an empty state.  This means no types, no world, etc.
  2914. Then @i{Xconq} reads and interprets
  2915. all of the game modules that have been requested.
  2916. These modules may overwrite each other arbitrarily.
  2917. Then any command line or startup options
  2918. are processed (this may involve an interactive dialog),
  2919. and the random number generator is initialized.
  2920. and players are matched with sides
  2921. (any sides needed for players will be created and named at this time).
  2922. @i{Xconq} then executes a number of @i{synthesis methods}
  2923. to do various kinds of setup.
  2924.  
  2925. (Some interfaces might allow for confirmation of the setup before
  2926. launching into the game proper, but this cannot be assumed.)
  2927.  
  2928. Since the details of good game synthesis can be complicated,
  2929. synthesis methods are simply wired-in pieces of code.
  2930. Each method is self-contained; it assumes the game state to be valid,
  2931. it will determine its own applicability and
  2932. produce a valid result.  It will also acquire any data that it
  2933. needs, so does not require any special setup;  however, a method
  2934. may fail to run if it cannot find that data.
  2935. For instance, the usual fractal
  2936. terrain generator needs percentiles for each terrain type, and
  2937. will not function without them.  It may be that all the requested
  2938. synthesis methods fail; this is OK if @i{Xconq}'s data is present
  2939. and consistent, but otherwise @i{Xconq} will shut itself down, since
  2940. it has no remaining alternatives (think of this as a serious
  2941. programming error and fix the game design).
  2942.  
  2943. @deffn GlobalVariable @code{player-mix-default} form
  2944. @end deffn
  2945.  
  2946. @deffn GlobalVariable @code{player-mix-required} form
  2947. @end deffn
  2948.  
  2949. @section The Synthesis Method List
  2950.  
  2951. The synthesis method list specifies which methods will be run,
  2952. and in what order.
  2953. After they have all been run, @i{Xconq} runs a consistency and completeness
  2954. check.  For instance, there should be a world with terrain everywhere.
  2955. Failure at this point is fatal; @i{Xconq} will either exit
  2956. or return to a game setup dialog.
  2957.  
  2958. @deffn GlobalVariable @code{synthesis-methods} method-list
  2959. This variable is a list of synthesis methods.
  2960. If the list is empty, no synthesis methods will be run.
  2961. @end deffn
  2962.  
  2963. The list of synthesis methods is ordered, but should not contain duplicates
  2964. (it's conceivable that there is some reason to run a method twice, but
  2965. most won't do anything if they've already been executed once).
  2966.  
  2967. The default synthesis method list is
  2968. @example
  2969. (make-fractal-percentile-terrain
  2970.  make-countries
  2971.  make-independent-units
  2972.  make-roads
  2973.  make-rivers
  2974.  init-supplies
  2975.  name-geographical-features
  2976. )
  2977. @end example
  2978.  
  2979. The synthesis method list may also contain items of the form
  2980.  
  2981. @example
  2982. ("program" forms...)
  2983. @end example
  2984.  
  2985. For each of these items, @i{Xconq} will attempt to find and run
  2986. an external program named @code{"program"},
  2987. giving it as input the result of evaluating the @code{forms},
  2988. and then reading the output of the program, which must be a valid
  2989. game module.  Any further details will depend on your system,
  2990. since each will use different conventions.
  2991. Note that this is NOT a portable construct; you cannot assume that
  2992. everybody will have built and installed the program you're using.
  2993.  
  2994. @subsection Fractal World
  2995.  
  2996. @deffn SynthesisMethod @code{make-fractal-percentile-terrain}
  2997. This method generates the terrain layer of a world.
  2998. It works by generating two distinct layers of random blobs,
  2999. known as the ``alt'' and ``wet'' layers,
  3000. then decides on a terrain type for each cell.
  3001. If elevations are defined,
  3002. then this method will use the alt layer to produce elevations. [how?]
  3003. @end deffn
  3004.  
  3005. @deffn GlobalVariable @code{alt-blob-density} n
  3006. @end deffn
  3007. @deffn GlobalVariable @code{wet-blob-density} n
  3008. These variables are the number of blobs to put down, at a rate of 1 per 10,000 cells.
  3009. Defaults to @code{500}.
  3010. @end deffn
  3011.  
  3012. @deffn GlobalVariable @code{alt-blob-size} n.f%
  3013. @end deffn
  3014. @deffn GlobalVariable @code{wet-blob-size} n.f%
  3015. These variables are the average number of cells in a blob,
  3016. expressed as hundredths of a percent of the number of cells in the world.
  3017. Defaults to @code{100}.
  3018. @end deffn
  3019.  
  3020. @deffn GlobalVariable @code{alt-blob-height} n
  3021. @end deffn
  3022. @deffn GlobalVariable @code{wet-blob-height} n
  3023. These variable are the amounts by which to increment or decrement within a blob.
  3024. Defaults to @code{1000}.
  3025. @end deffn
  3026.  
  3027. @deffn GlobalVariable @code{alt-smoothing} n
  3028. @end deffn
  3029. @deffn GlobalVariable @code{wet-smoothing} n
  3030. These variables specify the number of averaging steps
  3031. to perform after the blobs have been generated.
  3032. Defaults to @code{2}.
  3033. @end deffn
  3034.  
  3035. @deffn TerrainTypeProperty @code{alt-percentile-min} n%
  3036. @end deffn
  3037. @deffn TerrainTypeProperty @code{alt-percentile-max} n%
  3038. @end deffn
  3039. @deffn TerrainTypeProperty @code{wet-percentile-min} n%
  3040. @end deffn
  3041. @deffn TerrainTypeProperty @code{wet-percentile-max} n%
  3042. These properties are
  3043. the percentiles of elevations and moistures that result in the given
  3044. terrain type.
  3045. Percentile ranges may overlap, in which case the earlier-defined
  3046. terrain type will be used.
  3047. If a cell has a alt and wet that does not fall in any of the ranges,
  3048. then terrain type 0 will be used there and players will be warned.
  3049. Mins defaults to @code{0}, maxes to @code{100}.
  3050. @end deffn
  3051.  
  3052. @subsection Maze World
  3053.  
  3054. @deffn SynthesisMethod @code{make-maze-terrain}
  3055. This method creates terrain that looks like a maze.
  3056. @end deffn
  3057.  
  3058. @deffn TerrainTypeProperty @code{maze-room-occurrence} n
  3059. This property is the weighted amount of this terrain type
  3060. in rooms in the maze.
  3061. @end deffn
  3062.  
  3063. @deffn TerrainTypeProperty @code{maze-passage-occurrence} n
  3064. This property is the weighted amount of this terrain type
  3065. in passageways in the maze.
  3066. @end deffn
  3067.  
  3068. @deffn GlobalVariable @code{maze-room-density} n
  3069. This variable is the fraction of the maze that is room.
  3070. @end deffn
  3071.  
  3072. @deffn GlobalVariable @code{maze-passage-density} n
  3073. This variable is the fraction of the area that is passageway.
  3074. @end deffn
  3075.  
  3076. @subsection Random World
  3077.  
  3078. The random world generator just assigns terrain and elevations randomly.
  3079.  
  3080. @deffn SynthesisMethod @code{make-random-terrain}
  3081. This method generates completely random terrain.
  3082. It uses a simple weighting to govern how much
  3083. of each terrain type appears, and makes random elevations as well.
  3084. @end deffn
  3085.  
  3086. @deffn TerrainTypeProperty @code{occurrence} n
  3087. This property is the percentage of the world that will be of this type.
  3088. Defaults to @code{1}.
  3089. @end deffn
  3090.  
  3091. @subsection Earthlike World
  3092.  
  3093. Earthlike generation uses algorithms that more closely approximate
  3094. realistic terrain.
  3095.  
  3096. @deffn SynthesisMethod @code{make-earthlike-terrain}
  3097. This method generates terrain that approximates what actually
  3098. appears on Earth.
  3099. @end deffn
  3100.  
  3101. @subsection River Generation
  3102.  
  3103. Rivers are borders or connections consisting of ``watery terrain''
  3104. that run downhill to regions of water.
  3105.  
  3106. @deffn SynthesisMethod @code{make-rivers}
  3107. This method looks for a border or connection
  3108. terrain type with a @code{subtype-x} of @code{river-x}.
  3109. then uses the world's elevation data to run rivers downhill
  3110. (always choosing the lowest of possible adjacent locations)
  3111. until they reach cell terrain with a @code{subtype} > 0.
  3112. This method will not run if there are no appropriate terrain types,
  3113. nor if there is no elevation data.
  3114. @end deffn
  3115.  
  3116. @deffn TerrainTypeProperty @code{river-chance} n%
  3117. This property is the chance that a river will start in or around a cell of this
  3118. terrain type.
  3119. Defaults to @code{0}.
  3120. @end deffn
  3121.  
  3122. @deffn GlobalVariable @code{river-sink-terrain} t
  3123. If the value of this variable is a terrain type, then a cell completely
  3124. surrounded by river will be changed to be this type.
  3125. Defaults to @code{non-terrain}.
  3126. @end deffn
  3127.  
  3128. Note that the algorithm computes rivers in a deterministic way,
  3129. so high values of @code{river-chance} do not result in tangled rivers.
  3130.  
  3131. [does not use valley-x yet]
  3132.  
  3133. @subsection Road Generation
  3134.  
  3135. The road generation method makes networks of connection terrain between
  3136. particular unit types, usually those resembling cities.
  3137.  
  3138. @deffn SynthesisMethod @code{make-roads}
  3139. This methods synthesizes roads for an area.
  3140. For any connection type of terrain, if no layer has been created for it
  3141. already, and the type has a @code{subtype-x} of 3,
  3142. put down roads between any pair of units whose
  3143. @code{road-chance} is nonzero.
  3144. The method will attempt to share road routes whenever possible,
  3145. and choose terrain according to @code{road-into-chance}.
  3146. @end deffn
  3147.  
  3148. @deffn Table @code{road-chance} u1 u2 -> n%
  3149. This table is the chance that a road will be laid, running
  3150. from a unit of type @var{u1} to one of type @var{u2}.
  3151. This is not a symmmetrical relationship.
  3152. Defaults to @code{0}.
  3153. @end deffn
  3154.  
  3155. @deffn Table @code{road-into-chance} t1 t2 -> n%
  3156. This table is the chance that a road will be chosen to pass
  3157. from terrain of type @var{t1} into terrain of type @var{t2}.
  3158. Defaults to @code{100}.
  3159. @end deffn
  3160.  
  3161. @subsection Making Countries
  3162.  
  3163. The @code{make-countries} method is the usual way to set up a side's
  3164. starting units.
  3165.  
  3166. @deffn SynthesisMethod @code{make-countries}
  3167. This method works by looking for a likely place for the country,
  3168. randomly places a basic set of starting units within that area,
  3169. then expands the country outwards.
  3170. The parameters give you control over the mix of terrain types
  3171. in the country, as well as the size and relative positions of the
  3172. different countries.
  3173. This method runs on any side with fewer units than it is supposed
  3174. to start with, as given by the parameters below.
  3175. It places groups of units at locations separated from each other
  3176. by specified distances.
  3177. @end deffn
  3178.  
  3179. @deffn GlobalVariable @code{country-radius-min} dist
  3180. This variable is the radius of the country's initial area.
  3181. Defaults to @code{-1}, which allows the algorithm to calculate a ``reasonable''
  3182. country size appropriate to the given number of units.
  3183. @end deffn
  3184.  
  3185. @deffn GlobalVariable @code{country-separation-min} dist
  3186. @end deffn
  3187. @deffn GlobalVariable @code{country-separation-max} dist
  3188. These variables are the minimum and maximum
  3189. distances of country centers from each other, in cells.
  3190. If small, countries will mostly overlap;
  3191. if very large, then attempts to use small worlds will fail;
  3192. if the max and min are too close to each other, placements can also fail.
  3193. For both of these, a value of @code{-1} disables their effect.
  3194. Both default to @code{-1}.
  3195. @end deffn
  3196.  
  3197. The max separation bound needs to be satisfied for a country
  3198. with respect to only @i{one} other country,
  3199. so for instance the final layout may involve a long
  3200. ``string'' of countries where the first and last countries are very far apart
  3201. from each other.
  3202. The minimum bound must be satisfied for all pairs of countries.
  3203.  
  3204. @deffn TerrainTypeProperty @code{country-terrain-min} n
  3205. This property is the minimum amount of terrain
  3206. that must be within the country's initial radius.
  3207. Defaults to @code{0}.
  3208. @end deffn
  3209.  
  3210. @deffn TerrainTypeProperty @code{country-terrain-max} n
  3211. This property is the most terrain of the given type that may appear.
  3212. If @code{-1}, then any amount may be present.
  3213. Defaults to @code{-1}.
  3214. @end deffn
  3215.  
  3216. @deffn UnitTypeProperty @code{start-with} n
  3217. @end deffn
  3218. @deffn UnitTypeProperty @code{independent-near-start} n
  3219. These properties set the number of units of the given type in a player's country.
  3220. These units are randomly scattered within the initial radius,
  3221. and the @code{favored} table (see below) decides which terrains
  3222. will be used.  Units may be placed inside each other; in fact,
  3223. units with no favored terrain will be made into occupants if possible.
  3224.  
  3225. The independent units will be placed after the ones belonging to the side,
  3226. so on the average they will get the less desirable locations in the country.
  3227. Both independent and the side's units will be named using the side's namers.
  3228. @end deffn
  3229.  
  3230. @deffn Table @code{favored-terrain} u t -> n%
  3231. This table sets
  3232. the probability of the unit type being on the given type of terrain at the
  3233. outset.  A value of @code{0} is an absolute prohibition against placing
  3234. the unit on that type of terrain, thus every game must specify at least
  3235. one non-zero value for some terrain type and some initial unit type.
  3236. Defaults to @code{100}.
  3237. @end deffn
  3238.  
  3239. Once the initial country area has been set up,
  3240. then you can allow the countries to expand outwards.
  3241. Expansion occurs at the same rate for all countries.
  3242. Countries may expand into and through each other.
  3243.  
  3244. @deffn TerrainTypeProperty @code{country-growth-chance} n%
  3245. This property is the chance that a country will expand onto an unclaimed cell
  3246. of the given terrain type.
  3247. Defaults to @code{100}.
  3248. @end deffn
  3249.  
  3250. @deffn TerrainTypeProperty @code{country-takeover-chance} n%
  3251. This property is the chance that a country will expand onto another country's cell
  3252. of the given terrain type.
  3253. Defaults to @code{0}.
  3254. @end deffn
  3255.  
  3256. @deffn UnitTypeProperty @code{unit-growth-chance} n.f%
  3257. This property is the chance that a unit of the given type will be placed
  3258. when the country expands onto a cell.
  3259. The unit will only be placed if the @code{favored} chance is also true.
  3260. Defaults to @code{0}.
  3261. @end deffn
  3262.  
  3263. @deffn UnitTypeProperty @code{independent-growth-chance} n.f%
  3264. This property is the chance that an independent unit of the given type will be placed
  3265. when the country expands onto a cell.
  3266. The @code{favored} chance is also evaluated.
  3267. Defaults to @code{0}.
  3268. @end deffn
  3269.  
  3270. @deffn UnitTypeProperty @code{unit-takeover-chance} n.f%
  3271. This property is the chance that a unit of the given type in another country and
  3272. belonging to another side will be given to the growing side.
  3273. Defaults to @code{0}.
  3274. @end deffn
  3275.  
  3276. @deffn UnitTypeProperty @code{independent-takeover-chance} n.f%
  3277. This property is the chance that an independent unit of the given type in
  3278. another country will be given to the growing side.
  3279. Defaults to @code{0}.
  3280. @end deffn
  3281.  
  3282. @deffn GlobalVariable @code{country-radius-max} dist
  3283. This variable is a cap on the country growth process.
  3284. Values between @code{0} and @code{country-radius-min}
  3285. prevent country growth entirely,
  3286. while a value of @code{-1} allows growth to encompass the entire world.
  3287. Defaults to @code{0}.
  3288. @end deffn
  3289.  
  3290. @deffn UnitTypeProperty @code{country-units-max} n
  3291. This property is a cap on the number of units given to the side's country.
  3292. Defaults to @code{-1}, which disables any limit.
  3293. @end deffn
  3294.  
  3295. @deffn GlobalVariable @code{growth-stop-chance} n%
  3296. This variable is the chance that a country's growth will stop,
  3297. if during the current [ring or round] no new cells were added
  3298. to the country.
  3299. Defaults to @code{0}.
  3300. @end deffn
  3301.  
  3302. @deffn TerrainTypeProperty @code{country-people-chance} n%
  3303. This property is the chance that the people's side will be changed to
  3304. match that for the country they are in.
  3305. @end deffn
  3306.  
  3307. @subsection Making Independent Units
  3308.  
  3309. For many games, it is useful to have independent units scattered randomly
  3310. across the world.  For instance, gold mines and treasure hoards would be
  3311. good for an exploration game, and independent castles for a medieval game.
  3312.  
  3313. @deffn SynthesisMethod @code{make-independent-units}
  3314. This method scatters independent units randomly
  3315. over the world.
  3316. This method will not run if the specified density of independent units
  3317. has already
  3318. been achieved, for instance from a predefined world or from country placement.
  3319. Independent units that should be inside other independents will be
  3320. handled correctly.
  3321. @end deffn
  3322.  
  3323. @deffn Table @code{independent-density} u t -> n
  3324. This table is the total number of independent units appearing throughout the world,
  3325. at the rate of @var{n} per 10,000 cells
  3326. of the given terrain type.
  3327. Any independent units already placed are counted first,
  3328. so this value represents final density.
  3329. If the sum of values for a given unit type is nonzero,
  3330. then at least one unit of that type will
  3331. be placed, even if the world is very small (i.e. the calculation of
  3332. numbers rounds up not down).
  3333. Defaults to @code{0}.
  3334. @end deffn
  3335.  
  3336. This method uses the @code{favored-terrain} table as the chance that a given
  3337. unit will be placed at a randomly-chosen position,
  3338. and it will keep trying different positions until a suitable one is
  3339. found.
  3340.  
  3341. @deffn TerrainTypeProperty @code{independent-people-chance} .01n%
  3342. This property is the chance that the people of a cell with this terrain type
  3343. will be made independent.
  3344. Deafults to @code{0}.
  3345. @end deffn
  3346.  
  3347. @subsection Initial Supply
  3348.  
  3349. By default, all units start out empty of materials.
  3350. The supply initialization method gives each unit a starting supply,
  3351. according to the stockpile tables.
  3352.  
  3353. @deffn SynthesisMethod @code{make-initial-materials}
  3354. This method fills unit and cell supplies to specified levels.
  3355. It runs only on units actually present at the moment it runs.
  3356. [what about scheduled reinforcements?]
  3357. @end deffn
  3358.  
  3359. @deffn Table @code{unit-initial-supply} u m -> n
  3360. This table is the amount of each material that each unit will start out with.
  3361. If the initial supply is greater than unit's capacity,
  3362. then the unit will just be filled to capacity.
  3363. Defaults to @code{0}.
  3364. @end deffn
  3365.  
  3366. @deffn Table @code{terrain-initial-supply} t m -> n
  3367. This table is the amount of material @var{m} that each cell
  3368. with terrain @var{t} will start out with.
  3369. Defaults to @code{0}.
  3370. @end deffn
  3371.  
  3372. @subsection Naming Geographical Features
  3373.  
  3374. Although named geographical features don't affect the outcome of a game
  3375. in any way, they are useful for ``color'' and for identifying locations
  3376. more readably.
  3377.  
  3378. @deffn SynthesisMethod @code{name-geographical-features}
  3379. This method identifies and names regions as geographical features,
  3380. such as mountain ranges and islands.
  3381. @end deffn
  3382.  
  3383. @deffn GlobalVariable @code{feature-namers} feature-namer-list
  3384. This variable is a list of feature types and their associated namers.
  3385. This is used for features not intersecting any country
  3386. with a namer for the feature's type.
  3387. @end deffn
  3388.  
  3389. @deffn GlobalVariable @code{feature-types} feature-expr-list
  3390. This variable is a list of feature types that may be identified.
  3391. [("lake" (group (sea shallows) 1))]
  3392. [("peak" (high-point 1 1%))]
  3393. @end deffn
  3394.  
  3395. @subsection Naming Units
  3396.  
  3397. @deffn SynthesisMethod @code{name-units-randomly}
  3398. This method gives names to previously-unnamed units,
  3399. using their usual [?] naming methods.
  3400. @end deffn
  3401.  
  3402. @subsection Making a Random Date
  3403.  
  3404. @deffn SynthesisMethod @code{make-random-date}
  3405. @end deffn
  3406.  
  3407. [how is this controlled?]
  3408.  
  3409. @section Setup Postprocessing
  3410.  
  3411. Some initialization steps will be done after all synthesis methods
  3412. have been run.
  3413.  
  3414. @subsection Initial View
  3415.  
  3416. By default, each side starts out knowing only what its units can
  3417. normally see at the beginning of the first turn.
  3418. These parameters alter that initial view.
  3419.  
  3420. @deffn GlobalVariable @code{terrain-seen} t/f
  3421. This variable is @code{true} if all the terrain of the world is known initially.
  3422. Defaults to @code{false}.
  3423. @end deffn
  3424.  
  3425. @deffn UnitTypeProperty @code{initial-seen-radius} dist
  3426. This property specifies the radius of the area seen around each of
  3427. the starting units.
  3428. It computes visibility of terrain (cells and borders) only.
  3429. Defaults to @code{1} (which is a no-op if the unit's @code{vision-range}
  3430. is greater than or equal to 1).
  3431. @end deffn
  3432.  
  3433. @deffn UnitTypeProperty @code{already-seen} n%
  3434. This property is the chance to see units of this type at
  3435. the beginning of the game.
  3436. This applies only to units belonging to another side,
  3437. and on known terrain.
  3438. The effect is one-time, so if an @code{already-seen} unit changes
  3439. sides later on, other players will not see the change unless
  3440. they observe the unit for themselves.
  3441. Note that @code{see-always} does imply @code{already-seen}.
  3442. Defaults to @code{0}.
  3443. @end deffn
  3444.  
  3445. @deffn UnitTypeProperty @code{already-seen-independent} n%
  3446. This property is like @code{already-seen},
  3447. but for independent units specifically.
  3448. Defaults to @code{0}.
  3449. @end deffn
  3450.  
  3451. @node Naming, Other Parameters, Method List, Initialization
  3452.  
  3453. @section Naming and Text Generation
  3454.  
  3455. @i{Xconq} can generate names for sides, units, and geographical features.
  3456.  
  3457. @subsection Naming Sides
  3458.  
  3459. Side naming is special, because several different but related names
  3460. have to be produced.
  3461.  
  3462. @deffn Variable @code{side-library} side-info@dots{}
  3463. This variable is a weighted list of groups of side properties,
  3464. each of which may be used to fill in a side.
  3465. @end deffn
  3466.  
  3467. The form of each side name entry is basically a subset of the
  3468. side's properties:
  3469. @example
  3470. ([weight] ... (name "name") ... (color-scheme "colors") ...)
  3471. @end example
  3472. Each entry can include as many or as few of the attributes as desired;
  3473. any missing will be filled in from the usual defaults.
  3474. The optional @var{weight} is a number that adjusts the probability of selection
  3475. of the given side name set; it defaults to 1, and the probability is scaled
  3476. according to the sum of the weights for all the sides listed.
  3477. If any property value is a namer, then the namer will be run.
  3478. (Note that if multiple namers are specified, they cannot be guaranteed
  3479. to coordinate with each other, so you can end up with a side noun
  3480. that is inappropriate for its corresponding side name.)
  3481.  
  3482. @subsection Namers
  3483.  
  3484. Since one of the purposes of naming is to identify objects uniquely,
  3485. any name generator should be able to maintain some memory as to
  3486. what has been generated already.
  3487. The objects that do this are @dfn{namers}.
  3488.  
  3489. @deffn Form @code{namer} [symbol/id] method rejects@dots{}
  3490. This form defines an instance of a namer, with either the symbolic
  3491. name or numeric id.  If either matches the name or id of an existing
  3492. namer, then the old namer will be overwritten, otherwise a new one
  3493. will be created.
  3494. The @var{method} must be one of the naming methods listed below,
  3495. and @var{rejects} defines what names may not be produced (its exact
  3496. interpretation depends on the method).
  3497. @end deffn
  3498.  
  3499. @subsection Naming Methods
  3500.  
  3501. As with general synthesis, @i{Xconq} has a number of @dfn{naming methods}
  3502. available.
  3503.  
  3504. An implementation is free to define additional naming methods.
  3505.  
  3506. @deffn NamingMethod @code{random} names...@dots{}
  3507. This method picks a name from the given list of names
  3508. and removes that name from the list 
  3509. @end deffn
  3510.  
  3511. @deffn NamingMethod @code{junky}
  3512. This method produces a gobbledy-gook name, very techy-looking.
  3513. @end deffn
  3514.  
  3515. @deffn NamingMethod @code{grammar} root max-length rules@dots{}
  3516. This method defines a grammar, where @var{root} is the root symbol,
  3517. @var{max-length} is a limit on the length of the generated names
  3518. (in characters),
  3519. and @var{rules} is a list of rules of the form
  3520. @example
  3521. (@var{symbol} ([sym] [weight] @var{symbol/string/list} [n] @dots{}))
  3522. @end example
  3523. @end deffn
  3524.  
  3525. The generation process works by substituting one of the rule's alternatives
  3526. for the symbol, starting with the root symbol.
  3527. The probability of an alternative being selected is arrived at by
  3528. adding up the optional weights @var{weight} (assuming missing weights
  3529. to be @code{1}), and choosing with a probability of the weight
  3530. divided by the total sum of weights.
  3531. Thus the weights need not add up to any particular value.
  3532.  
  3533. Strings get used directly.
  3534. If a symbol in the rule's chosen expansion does not appear as the 
  3535. lefthand side in any rule, then it will be handled as a string,
  3536. otherwise it will be expanded in turn.
  3537. If the symbol matches a namer's name, then that namer will be
  3538. run (passing the same object??) and its result incorporated.
  3539. A list should be a list of strings and symbols, and the expansion
  3540. of each will be concatenated.
  3541.  
  3542. @deffn GlobalConstant @code{any}
  3543. [???]
  3544. @end deffn
  3545.  
  3546. @deffn GlobalConstant @code{or}
  3547. @end deffn
  3548.  
  3549. @deffn GlobalConstant @code{reject}
  3550. A special rule headed by @code{reject} is a list of substrings
  3551. that should not appear in a generated name; this is a convenient
  3552. way to filter out particularly unlovely results.
  3553. @end deffn
  3554.  
  3555. @deffn GlobalConstant @code{capitalize}
  3556. Directs capitalization of a nonterminal.
  3557. @end deffn
  3558.  
  3559. [text is not actually different from a namer?]
  3560.  
  3561. @deffn Form @code{text} [symbol/id] method rejects@dots{}
  3562. @end deffn
  3563.  
  3564. [elsewhere?]
  3565. @deffn GlobalVariable @code{action-messages} patterns
  3566. @end deffn
  3567.  
  3568. @deffn GlobalVariable @code{event-messages} patterns
  3569. @end deffn
  3570.  
  3571. @node Other Parameters, New Methods, Naming, Initialization
  3572.  
  3573. @section Other Initialization Parameters
  3574.  
  3575. @deffn GlobalVariable @code{edge-terrain}
  3576. This variable is the type of terrain to fill in on all the edges of a world.
  3577. The edges of a world have little or no effect on the game,
  3578. but the terrain type should be something distinctive, so that players
  3579. can recognize the edges easily.  (For instance, ice is usually a good choice
  3580. for edges, but probably not on a map of Antarctica!)
  3581. @end deffn
  3582.  
  3583. @section Actions in General
  3584.  
  3585. The parameters in this chapter define and regulate the various actions that are
  3586. available to units during a game.
  3587.  
  3588. Actions are always started and completed (including all of their effects)
  3589. within the same turn, and a unit can only do one of them at a time.
  3590.  
  3591. All actions are in theory available to all units, but the parameters
  3592. can be set so as to deny any action type to any unit type.
  3593. See the descriptions with each action type.
  3594.  
  3595. All action is limited by action points.
  3596. Each unit gets a certain number at the beginning of each
  3597. turn and expends them in the course of doing things.
  3598. The usual expenditure is
  3599. one point per action, but may be more, as defined for each type of action.
  3600. A unit action must always consume at least one action point.
  3601.  
  3602. Units can accumulate acp from turn to turn, and they can also reduce
  3603. acp below zero.
  3604.  
  3605. @deffn UnitTypeProperty @code{acp-per-turn} acp
  3606. This property is the basic allowance of action points that a unit gets each turn.
  3607. Defaults to @code{1}.
  3608. @end deffn
  3609.  
  3610. @deffn UnitTypeProperty @code{acp-min} acp
  3611. This property specifies
  3612. how far into ``action debt'' a unit can go during a turn before it is prevented
  3613. entirely from acting.
  3614. A unit with acp < 1 at the beginning of a turn cannot do anything at all.
  3615. Defaults to @code{0}.
  3616. @end deffn
  3617.  
  3618. @deffn UnitTypeProperty @code{acp-max} acp
  3619. This property is
  3620. the maximum number of action points that a unit can save up.
  3621. The value @code{-1} means that @code{acp-max} is equal to @code{acp}.
  3622. Extra acp is silently lost.
  3623. Defaults to @code{-1}. 
  3624. @end deffn
  3625.  
  3626. @deffn UnitTypeProperty @code{free-acp} acp
  3627. This property is
  3628. the value is the amount by which the action points for some
  3629. action can exceed the unit's currently available acp
  3630. and still allow that action.
  3631. Defaults to @code{-1}, which means enough free acp to
  3632. allow any action.
  3633. @end deffn
  3634.  
  3635. Note that a unit with an acp of 0 is completely unintelligent, about like
  3636. a cow patty.  Cow patties can be useful for blocking paths, hiding behind,
  3637. and suchlike, and have the advantage that once they're in place, you don't
  3638. have to manage them.  Other units will have to pick them up and put them
  3639. down, of course.
  3640.  
  3641. @deffn Table @code{material-to-act} u m -> n
  3642. This table is a minimum amount of @var{m} needed for @var{u} to be able to act.
  3643. The material is not consumed.
  3644. Defaults to @code{0}.
  3645. @end deffn
  3646.  
  3647. @deffn UnitTypeProperty @code{acp-damage-effect} xxx
  3648. @end deffn
  3649.  
  3650. @deffn Table @code{occupant-acp-effect} u1 u2 -> n
  3651. Defaults to @code{100}.
  3652. @end deffn
  3653.  
  3654. @deffn UnitTypeProperty @code{acp-per-turn-min} acp
  3655. @end deffn
  3656. @deffn UnitTypeProperty @code{acp-per-turn-max} acp
  3657. This property limits on effect of occupants, damage, etc.
  3658. Defaults to @code{1}.
  3659. @end deffn
  3660.  
  3661. @subsection Action Ordering
  3662.  
  3663. @deffn GlobalVariable @code{use-side-priority} t/f
  3664. This variable is @code{true} if the sides may only act one at a time;
  3665. otherwise, all sides and units may move simultaneously during a turn.
  3666. Defaults to @code{false}.
  3667. @end deffn
  3668.  
  3669. @deffn UnitTypeProperty @code{action-priority} n
  3670. This property is the order in which units of this type will act.
  3671. Higher numbers act earlier.
  3672. If the difference between the priority of one type and another
  3673. is greater than 100, then the earlier-acting units must finish acting
  3674. before the later-acting units, otherwise a player can rearrange the actual
  3675. acting order as desired.
  3676. Defaults to @code{0}.
  3677. @end deffn
  3678.  
  3679. @deffn GlobalVariable @code{actions-are-buffered} t/f
  3680. This variable is @code{true} if all the units of the same priority
  3681. must specify their actions first and then execute
  3682. them all at once,
  3683. rather than deciding and executing before the next unit gets to act.
  3684. Defaults to @code{false}.
  3685. @end deffn
  3686.  
  3687. @node Movement, Occupancy Parameters, Action Parameters, Unit Actions
  3688.  
  3689. @subsection Movement
  3690.  
  3691. Movement is the most common sort of action.
  3692. This section covers movement over open terrain;
  3693. the next section discusses interaction with transports.
  3694.  
  3695. The general theory of movement is that a unit not in a transport
  3696. crosses its current cell terrain to the edge of the cell,
  3697. crosses any border terrain, and then moves into the destination cell,
  3698. OR it moves onto connection terrain,
  3699. travels along connection terrain to the new cell, and maybe 
  3700. moves off the connection.
  3701. If the unit starts in a transport, then the transport may ferry
  3702. the unit over some of the intervening terrain,
  3703. possibly as far as the unit's destination.
  3704.  
  3705. A unit's basic movement rate is defined by its @dfn{speed},
  3706. which is a ratio of the the unit's acp.
  3707. A speed of 100% means that the unit can potentially
  3708. enter as many cells as it has acp,
  3709. while a speed of 20% means that the unit uses at least
  3710. 5 acp to enter a cell.
  3711.  
  3712. Movement can only succeed if several conditions are met:
  3713. the unit must be able to cross
  3714. the border terrain, the destination must be inside the world (but see below),
  3715. it must be able to exist on the terrain of the destination.
  3716.  
  3717. @deffn ActionType @code{move} x y z
  3718. This is the action that a unit performs to go from one location to another.
  3719. The destination must be within the @code{move-range} of the unit.
  3720. @end deffn
  3721.  
  3722. @deffn UnitTypeProperty @code{acp-to-move} acp
  3723. This property is the number of acp a unit uses to do one move action.
  3724. Defaults to @code{1}.
  3725. @end deffn
  3726.  
  3727. @deffn UnitTypeProperty @code{speed} mp
  3728. This property is the basic number of movement points that a normal
  3729. undamaged unit gets at the beginning of each turn.
  3730. Defaults to @code{0}.
  3731. @end deffn
  3732.  
  3733. @deffn UnitTypeProperty @code{speed-min} mp
  3734. This property is the worst-case speed of a unit.
  3735. Defaults to @code{0}.
  3736. @end deffn
  3737.  
  3738. [following needs work again]
  3739.  
  3740. @deffn UnitTypeProperty @code{hp-at-max-speed} mp
  3741. This property is the minimum number of hp at which the unit retains its max speed.
  3742. Defaults to @code{0}.
  3743. @end deffn
  3744.  
  3745. @deffn UnitTypeProperty @code{hp-at-min-speed} hp
  3746. This property is the maximum number of hp at which the unit's speed is at its minimum.
  3747. Defaults to @code{0}.
  3748. @end deffn
  3749.  
  3750. For hp between @code{hp-at-min-speed} and @code{hp-at-max-speed},
  3751. the unit's speed will be interpolated in the obvious way.
  3752.  
  3753. @deffn Table @code{mp-per-occupant} u1 u2 -> n%
  3754. This table is the percent change in the speed
  3755. of type @var{u1} for each occupant of type @var{u2}.
  3756. If the basic speed of @var{u1} is @code{0},
  3757. then the multiplication is performed
  3758. as if the speed were @code{1} instead.
  3759. Defaults to @code{100}.
  3760. @end deffn
  3761.  
  3762. @deffn UnitTypeProperty @code{speed-max} mp
  3763. This property is the upper bound on a unit's movement in one turn.
  3764. Defaults to @code{0}.
  3765. @end deffn
  3766.  
  3767. @deffn UnitTypeProperty @code{move-range} n
  3768. This property is the maximum distance allowed to the destination cell.
  3769. Defaults to @code{1}.
  3770. @end deffn
  3771.  
  3772. @deffn UnitTypeProperty @code{speed-damage-effect} xxx
  3773. @end deffn
  3774.  
  3775. Any move between cells will cost at least one movement point.
  3776. Some mp costs may be negative, but the total mp for a move will always
  3777. be at least 1.
  3778.  
  3779. @deffn Table @code{mp-to-leave-terrain} u t -> mp
  3780. This table is the mp cost to leave a cell of type @var{t}.
  3781. If @var{t} is a border type, this cost is never used.
  3782. If @var{t} is a connection type, this cost is the cost of leaving the
  3783. connection terrain for the open terrain of the cell.
  3784. If @var{t} is a coating type, then this value adds to the cost
  3785. of leaving the cell.
  3786. Defaults to @code{0}.
  3787. @end deffn
  3788.  
  3789. @deffn Table @code{mp-to-enter-terrain} u t -> mp
  3790. This table is the mp cost to enter a cell of type @var{t}.
  3791. If @var{t} is a border type, this cost is the
  3792. cost of crossing the border.
  3793. If @var{t} is a connection type, this cost is the cost of entering the
  3794. connection terrain from the open terrain of the cell.
  3795. If @var{t} is a coating type, then this value adds to the cost
  3796. of entering the cell.
  3797. Defaults to @code{1}.
  3798. @end deffn
  3799.  
  3800. @deffn Table @code{mp-to-traverse} u t -> mp
  3801. This table gives the cost to travel
  3802. along a connection or border of the given type.
  3803. (note that the other costs are irrelevant if
  3804. unit starts and ends its movement on the connection).
  3805.  
  3806. A special type of move known as a @dfn{border slide} can occur when the
  3807. endpoints of a border touch on the start and destination cells.
  3808. Sliding works like normal movement
  3809. that happens to end up on a nonadjacent cell.
  3810. Same rules for permissibility apply.
  3811. If the value is negative, then border sliding is not possible.
  3812.  
  3813. Defaults to @code{1}.
  3814. @end deffn
  3815.  
  3816. If both enter/traverse/leave and enter/leave movement is possible,
  3817. then @i{Xconq} will automatically choose the cheapest alternative.
  3818.  
  3819. @deffn Table @code{mp-to-ascend} u t -> mp
  3820. @end deffn
  3821. @deffn Table @code{mp-to-descend} u t -> mp
  3822. These tables are the mp cost to go from the min possible elevation
  3823. to the max possible elevation in the world.
  3824. This is interpolated and rounded down.
  3825. @var{t} is the type of terrain being left.
  3826. Defaults to @code{0}.
  3827. @end deffn
  3828.  
  3829. Each unit type has a range of altitudes within which it normally operates.
  3830.  
  3831. @deffn Table @code{altitude-min} u t -> n
  3832. This table is the minimum altitude possible for each type of unit
  3833. on each type of terrain.
  3834. Defaults to @code{0}.
  3835. @end deffn
  3836.  
  3837. @deffn Table @code{altitude-max} u t -> n
  3838. This table is the maximum altitude possible for each type of unit
  3839. on each type of terrain.
  3840. Defaults to @code{0}.
  3841. @end deffn
  3842.  
  3843. @deffn UnitTypeProperty @code{mp-to-leave-world} mp
  3844. This property is an additional move cost to leave the world entirely.
  3845. To leave, the unit must be within its @code{move-range} of an edge,
  3846. and have sufficient mp to move into the terrain in the edge cell
  3847. designated as the destination of the move.
  3848. If the value is @code{-1}, then the unit may never leave.
  3849. Defaults to @code{-1}.
  3850. @end deffn
  3851.  
  3852. @deffn UnitTypeProperty @code{free-mp} mp
  3853. This property is the amount by which the move points can ``go into the red''
  3854. and still allow one more move.
  3855. Defaults to @code{0}.
  3856. @end deffn
  3857.  
  3858. ZOC is exerted only over units out in the open, has no effect on occupants,
  3859. unless they leave their transport.
  3860. Occupants can themselves exert a ZOC,
  3861. if @code{occupant-can-fight} is true.
  3862. ZOC applies to all units on a hostile side.
  3863.  
  3864. @deffn Table @code{zoc-range} u1 u2 -> dist
  3865. This table is the maximum distance at which type @var{u1}
  3866. exerts a ZOC over type @var{u2}.
  3867. A value of @code{0} means that the unit controls only its own cell,
  3868. and a value of @code{-1} means that the unit does not exert a ZOC at all.
  3869. Defaults to @code{0}.
  3870. @end deffn
  3871.  
  3872. @deffn Table @code{zoc-into-terrain} u t -> t/f
  3873. This table is @code{true} if the unit exerts its ZOC into terrain @var{t}.
  3874. Defaults to @code{true}.
  3875. @end deffn
  3876.  
  3877. @deffn Table @code{zoc-from-terrain-effect} u t -> n
  3878. Defaults to @code{100}.
  3879. @end deffn
  3880.  
  3881. @deffn Table @code{mp-to-enter-zoc} u1 u2 -> mp
  3882. This table specifies extra movement points needed to enter the ZOC.
  3883. @code{-1} prevents entry entirely.
  3884. Defaults to @code{-1}.
  3885. @end deffn
  3886.  
  3887. @deffn Table @code{mp-to-leave-zoc} u1 u2 -> mp
  3888. This table specifies extra movement points needed to leave the ZOC.
  3889. @code{-1} prevents departure entirely.
  3890. Defaults to @code{0}.
  3891. @end deffn
  3892.  
  3893. @deffn Table @code{mp-to-traverse-zoc} u1 u2 -> mp
  3894. This table specifies extra movement points needed to move within the ZOC.
  3895. @code{-1} prevents traversing entirely.
  3896. Defaults to @code{0}.
  3897. @end deffn
  3898.  
  3899. If multiple units exert a ZOC into the same cell, then the mp cost
  3900. is the maximum of the different ZOC costs.
  3901.  
  3902. Units may use up some of their materials when they move.
  3903. Consumption happens after the move action, and only for successful moves.
  3904.  
  3905. @deffn Table @code{material-to-move} u m -> n
  3906. This table is the amount of each material that a unit of type @var{u}
  3907. must have in order to be able to move.
  3908. Defaults to @code{0}.
  3909. @end deffn
  3910.  
  3911. @deffn Table @code{consumption-per-move} u m -> n
  3912. This table is the amount of each material used by a unit to do one move action.
  3913. The amount taken is independent of terrain.
  3914. If the unit has less than the required amount of any of these materials,
  3915. it is immobilized until it gets more (this is tested before each move
  3916. action; note that this does not affect any other action, including
  3917. entering and leaving transports).
  3918. Defaults to @code{0}.
  3919. @end deffn
  3920.  
  3921. @node Occupancy Parameters, Tech Levels, Movement, Unit Actions
  3922.  
  3923. @subsection Entering and Leaving Transports
  3924.  
  3925. Units can be inside other units, and have units inside them, in a
  3926. tree-like fashion.  There is no limit on the depth of the tree,
  3927. but most occupant-transport relationships have other limits.
  3928.  
  3929. @deffn ActionType @code{enter} unit
  3930. This is the action to enter the given @var{unit}.
  3931. @end deffn
  3932.  
  3933. @deffn UnitTypeProperty @code{acp-to-enter-unit} acp
  3934. This property is the number of acp a unit uses to do one entry action.
  3935. Defaults to @code{1}.
  3936. @end deffn
  3937.  
  3938. @deffn Table @code{can-enter-independent} u1 u2 -> t/f
  3939. This table is true if a unit @var{u1} can enter an independent unit @var{u2}.
  3940. Defaults to @code{false}.
  3941. @end deffn
  3942.  
  3943. Entering and leaving incur mp costs as does movment,
  3944. but units with a speed of 0 may enter and leave transports.
  3945.  
  3946. @deffn Table @code{mp-to-enter-unit} u1 u2 -> n
  3947. This table is the extra movement points required for @var{u1}
  3948. to enter the transport @var{u2},
  3949. and vice versa (i.e. how much of transport's time is consumed by the process).
  3950. Defaults to @code{0}.
  3951. @end deffn
  3952.  
  3953. @deffn Table @code{mp-to-leave-unit} u1 u2 -> n
  3954. Similar to entry cost.
  3955. Defaults to @code{0}.
  3956. @end deffn
  3957.  
  3958. Note that these mp consumptions need not be symmetrical
  3959. between occupant and transport,
  3960. so for instance a passenger can use 2 of its mp to get on a transport,
  3961. while costing the transport only one of its mp.
  3962.  
  3963. @deffn Table @code{ferry-on-entry} u1 u2 -> ferry-type
  3964. @end deffn
  3965. @deffn Table @code{ferry-on-departure} u1 u2 -> ferry-type
  3966. This table specifies how much intervening terrain the unit @var{u2}
  3967. entering or leaving transport @var{u1}
  3968. will have to cross on its own (and thus incur the terrain's mp costs and
  3969. limitations).
  3970. Defaults to @code{to-dest}.
  3971. @end deffn
  3972.  
  3973. @deffn GlobalConstant @code{over-nothing}
  3974. This constant indicates
  3975. no ferrying, occupant must pay all costs to go to destination cell.
  3976. @end deffn
  3977.  
  3978. @deffn GlobalConstant @code{over-own}
  3979. This constant indicates that the
  3980. transport ferries over terrain of its own cell.
  3981. @end deffn
  3982.  
  3983. @deffn GlobalConstant @code{over-border}
  3984. This constant indicates that the
  3985. transport ferries over any border terrain also.
  3986. @end deffn
  3987.  
  3988. @deffn GlobalConstant @code{over-all}
  3989. This constant indicates that the
  3990. transport ferries to destination cell,
  3991. effectively puts occupant on middle of cell,
  3992. on connection terrain if necessary.
  3993. @end deffn
  3994.  
  3995. @subsection Research
  3996.  
  3997. Research is an action performed by a unit with the sole effect
  3998. of increasing its side's tech level.
  3999. Research cannot be performed by independent units.
  4000.  
  4001. @deffn ActionType @code{research} u
  4002. This is the action of researching the unit type @var{u}.
  4003. If the action is valid, then the tech level of the side
  4004. will increase.
  4005. Unit types with any tech crossover will also have their tech
  4006. levels adjusted.
  4007. @end deffn
  4008.  
  4009. @deffn UnitTypeProperty @code{acp-to-research} acp
  4010. This property is the number of action points used up by one research action.
  4011. Defaults to @code{0}, which disallows research.
  4012. @end deffn
  4013.  
  4014. @deffn Table @code{tech-per-research} u1 u2 -> .01n
  4015. This table is the gain in tech level resulting from a research action, expressed as
  4016. 1/100 of a level.  Gains of less than 100 are probabilistic [should describe
  4017. this concept in general, used by several parms]
  4018. Defaults to @code{0}.
  4019. @end deffn
  4020.  
  4021. @deffn UnitTypeProperty @code{tech-per-turn-max} tl
  4022. This property is a ceiling on the total gain of tech level possible in one turn
  4023. for each side and this unit type.
  4024. Defaults to @code{9999}.
  4025. @end deffn
  4026.  
  4027. @subsection Tooling Up
  4028.  
  4029. There are several stages in the construction of a unit: tooling up,
  4030. creation, and completion.  Tooling up is where the building unit
  4031. prepares to build, creation is the step where the new unit comes into
  4032. existence, and completion is where the new unit is brought up to being
  4033. operational.
  4034.  
  4035. For the player, this is mostly automatic; if tooling must be
  4036. done first, a user command to build will generate the appropriate actions.
  4037.  
  4038. Once the technology has been achieved, a unit that intends to construct
  4039. other units may need to tool up.
  4040. This is expressed as @dfn{tool points} or @dfn{tp}.
  4041. Tool points start at zero, can be increased by tooling actions,
  4042. and may gradually decline (representing wear and tear on the equipment).
  4043.  
  4044. @deffn ActionType @code{toolup} u
  4045. This is the action of tooling up to build a unit of type @code{u}.
  4046. The result is an increase in the tp for the acting unit.
  4047. @end deffn
  4048.  
  4049. @deffn UnitTypeProperty @code{acp-to-toolup} acp
  4050. This property gives the number of acp needed to do a toolup action.
  4051. Defaults to @code{0}, which disallows tooling up.
  4052. @end deffn
  4053.  
  4054. @deffn Table @code{tp-per-toolup} u1 u2 -> tp
  4055. This table is the number of tp gained by one tooling action.
  4056. Defaults to @code{0}.
  4057. @end deffn
  4058.  
  4059. @deffn Table @code{tp-to-build} u1 u2 -> tp
  4060. This table is the number of toolup points needed before a unit of type @var{u1}
  4061. can create or build a unit of type @var{u2}.
  4062. Defaults to @code{0}.
  4063. @end deffn
  4064.  
  4065. @deffn Table @code{tp-max} u1 u2 -> tp
  4066. This table is the maximum possible tooling.
  4067. Defaults to @code{0}.
  4068. @end deffn
  4069.  
  4070. @deffn Table @code{tp-attrition} u1 u2 -> tp
  4071. This table is the number of .01 tool points automatically lost at
  4072. the end of each turn.
  4073. Defaults to @code{0}.
  4074. @end deffn
  4075.  
  4076. @deffn Table @code{tp-crossover} u1 u2 -> n%
  4077. This table is the effective number of tool points for @var{u2} that is
  4078. guaranteed to exist, expressed as a percentage of the tool
  4079. points for @var{u1}.
  4080. [copy tech-crossover description here]
  4081. Defaults to @code{0}.
  4082. @end deffn
  4083.  
  4084. @subsection Creating a Unit
  4085.  
  4086. When a constructing unit is tooled up, the build action creates a unit
  4087. immediately and puts it in its designated location, whether inside the
  4088. unit doing the building or somewhere nearby.  This new unit, however, is
  4089. incomplete, representing the keel of the ship or the surveyor's
  4090. lines for an airstrip.  Incomplete units are thus basically skeletons,
  4091. with some unit characteristics, but unable to move or act in any way.
  4092. They also cannot have any occupants [problem for traditional bases].
  4093. Time spent on construction, then, goes into finishing these incomplete units.
  4094.  
  4095. @deffn ActionType @code{create-in} u unit
  4096. This action creates a new unit of type @var{u} occupying the given
  4097. unit @var{unit}.
  4098. The unit @var{unit} must have room for the new unit.
  4099. @end deffn
  4100.  
  4101. @deffn ActionType @code{create-at} u x y z
  4102. This action creates a new unit of type @var{u} in the open at
  4103. @var{x,y,z}.
  4104. The cell must have room for this new unit.
  4105. @end deffn
  4106.  
  4107. @deffn Table @code{acp-to-create} u1 u2 -> acp
  4108. This table is the acp used by @var{u1} to create a @var{u2}.
  4109. If zero, then @var{u1} cannot create a @var{u2}.
  4110. Defaults to @code{0}.
  4111. @end deffn
  4112.  
  4113. @deffn Table @code{separation-to-create-max} u1 u2 -> dist
  4114. This table is the maximum distance at which @var{u1} can create @var{u2}.
  4115. Defaults to @code{0}.
  4116. @end deffn
  4117.  
  4118. @deffn Table @code{cp-on-creation} u1 u2 -> cp
  4119. This table is the completeness of a unit of type @var{u2} when
  4120. created by a @var{u1}.
  4121. Defaults to @code{0}.
  4122. @end deffn
  4123.  
  4124. @deffn Table @code{material-to-create} u m -> n
  4125. This table is the total amount of a material type needed to create a unit.
  4126. Defaults to @code{0}.
  4127. @end deffn
  4128.  
  4129. @deffn Table @code{consumption-on-creation} u m -> n
  4130. This table is the amount of a material type consumed to create a unit.
  4131. Defaults to @code{0}.
  4132. @end deffn
  4133.  
  4134. @deffn Table @code{supply-on-creation} u m -> n
  4135. This table is the amount of supply that a newly created unit gets.
  4136. This supply is newly generated, does not come from anywhere else.
  4137. (Note that players could cheat by creating units, taking their supply,
  4138. and never completing them.)
  4139. Defaults to @code{0}.
  4140. @end deffn
  4141.  
  4142. @subsection Building a Unit
  4143.  
  4144. Once an incomplete unit has been created,
  4145. other units can help to complete it.
  4146.  
  4147. @deffn ActionType @code{build} unit
  4148. This action adds to the completeness of @var{unit}.
  4149. If the unit becomes complete, it will be given its initial supply,
  4150. acp, name, etc.
  4151. @end deffn
  4152.  
  4153. @deffn Table @code{acp-to-build} u1 u2 -> acp
  4154. This table is the acp used up by one build action by @var{u1}
  4155. when buiding a unit of type @var{u2}.
  4156. Defaults to @code{0}.
  4157. @end deffn
  4158.  
  4159. @deffn Table @code{cp-per-build} u1 u2 -> cp
  4160. This table is the amount of completeness of @var{u2}
  4161. added by each completion action performed by @var{u1}.
  4162. If @code{0}, then @var{u1} cannot contribute to completing @var{u2}.
  4163. Defaults to @code{0}.
  4164. @end deffn
  4165.  
  4166. @deffn Table @code{material-to-build} u m -> n
  4167. This table is the amount of each material that @var{u} must have
  4168. in order to build anything.
  4169. Defaults to @code{0}.
  4170. @end deffn
  4171.  
  4172. @deffn Table @code{consumption-per-build} u m -> n
  4173. Defaults to @code{0}.
  4174. @end deffn
  4175.  
  4176. @deffn Table @code{separation-to-build-max} u1 u2 -> dist
  4177. This table is the maximum distance allowed between a unit @var{u1} and the
  4178. incomplete unit @var{u2} it is working on.
  4179. Defaults to @code{0}, which requires the two units to be in
  4180. the same cell.
  4181. @end deffn
  4182.  
  4183. At a given point, incomplete units can make progress towards
  4184. completion on their own.  This is automatic because incomplete
  4185. units are unable to act, and occurs at a constant specified rate.
  4186.  
  4187. @deffn UnitTypeProperty @code{cp-to-self-build} cp
  4188. This property is the minimum completeness of the unit necessary before it
  4189. can work on itself.
  4190. Defaults to @code{0}.
  4191. @end deffn
  4192.  
  4193. @deffn UnitTypeProperty @code{cp-per-self-build} cp
  4194. This property is the completeness added each turn when a unit works on itself.
  4195. Defaults to @code{0}.
  4196. @end deffn
  4197.  
  4198. @deffn Table @code{supply-on-completion} u m -> n
  4199. This table is the minimum amount of supply guaranteed to a newly completed
  4200. unit.  If not already available to the unit, it will be newly generated.
  4201. Defaults to @code{0}.
  4202. @end deffn
  4203.  
  4204. @node Repair, Producing Materials, Construction, Unit Actions
  4205.  
  4206. @subsection Repair
  4207.  
  4208. Units can restore their own and each other's hp by doing repairs.
  4209. Repair requires a repair action.
  4210. The action points for this action
  4211. are taken from both the unit being repaired and
  4212. the repairer (using the same table @code{acp-to-repair}).
  4213. When a unit repairs itself, the action cost is counted once only.
  4214.  
  4215. @deffn ActionType @code{repair} unit
  4216. This is the action of repairing the given @var{unit}.
  4217. @end deffn
  4218.  
  4219. @deffn Table @code{acp-to-repair} u1 u2 -> acp
  4220. This table is the number of action points used up
  4221. by @var{u1} doing one repair action on @var{u2}.
  4222. Defaults to @code{0}, which disallows the action.
  4223. @end deffn
  4224.  
  4225. @deffn Table @code{hp-per-repair} u1 u2 -> .01hp
  4226. This table is the hundredths of a hp that a single repair action by @var{u1}
  4227. restores to @var{u2}.
  4228. The fraction of this over 100 is added to hp directly,
  4229. while the < 100 fraction is added probabilistically.
  4230. Defaults to @code{0}.
  4231. @end deffn
  4232.  
  4233. Materials may be needed and/or consumed during repair.
  4234. The materials will be taken from the
  4235. unit being repaired, then from the repairer.
  4236.  
  4237. @deffn Table @code{material-to-repair} u m -> .01n
  4238. This table is the amount of each material needed for one repair action.
  4239. As with repair, the < 100 part is average, and > 100 is guaranteed.
  4240. Defaults to @code{0}.
  4241. @end deffn
  4242.  
  4243. @deffn Table @code{consumption-per-repair} u m -> .01n
  4244. @end deffn
  4245.  
  4246. The repairing unit must also not be too damaged itself to do repairs.
  4247.  
  4248. @deffn Table @code{hp-to-repair} u1 u2 -> hp
  4249. This table is the minimum hp level required of @var{u1} to repair @var{u2}.
  4250. If less, then @var{u1} is too damaged to do any repairing.
  4251. Defaults to @code{1}, which allows repair always.
  4252. @end deffn
  4253.  
  4254. @node Producing Materials, Transferring Supply, Repair, Unit Actions
  4255.  
  4256. @subsection Producing Materials
  4257.  
  4258. Units can produce materials by explicit action.
  4259.  
  4260. @deffn ActionType @code{produce} m n
  4261. This action results in a quantity @var{n} of material @var{m}
  4262. coming into existence.
  4263. @end deffn
  4264.  
  4265. @deffn Table @code{acp-to-produce} u m -> acp
  4266. This table is the acp used up by one @code{produce} action.
  4267. Defaults to @code{0}.
  4268. @end deffn
  4269.  
  4270. @deffn Table @code{material-per-production??} u m -> n
  4271. This table is the amount of material produced by @var{u}
  4272. when acting to produce type @var{m}.
  4273. Defaults to @code{0}.
  4274. @end deffn
  4275.  
  4276. @node Transferring Materials, Changing Sides, Producing Materials, Unit Actions
  4277.  
  4278. @subsection Transferring Materials
  4279.  
  4280. Although most movement of materials between units happens automatically
  4281. (see backdrop economy description, section xxx),
  4282. players can also do it explicitly.
  4283. Players can both take materials from other units, and give a unit's
  4284. materials to others.
  4285.  
  4286. @deffn ActionType @code{transfer} unit m n
  4287. This is the action of transferring supply to the given unit @var{unit}.
  4288. The desired amount is @var{n};  if @var{m} is a valid material type,
  4289. then only that type will be transferred, otherwise the action will
  4290. transfer all types of materials possible.
  4291. The actual transfer amounts may be less than @var{n}.
  4292. [If @var{unit} is NULL, then is equiv to discarding material?]
  4293. @end deffn
  4294.  
  4295. @deffn Table @code{acp-to-unload} u1 m -> acp
  4296. @end deffn
  4297. @deffn Table @code{acp-to-load} u1 m -> acp
  4298. These tables are the number of action points used up by one material transfer
  4299. action from @var{u1} to @var{u2}.
  4300. The amount is independent of the material type being transferred.
  4301. If either value is @code{0}, then the material cannot be transferred.
  4302. Defaults to @code{0}.
  4303. @end deffn
  4304.  
  4305. @deffn Table @code{unload-max} u1 m -> n
  4306. @end deffn
  4307. @deffn Table @code{load-max} u2 m -> n
  4308. These two tables determine how much of material @var{m} can be transferred out
  4309. of a unit of type @var{u1} and into one of type @var{u2}
  4310. in one transfer action.
  4311. The actual quantity transferred by the action
  4312. is the minimum of these two values.
  4313. A value of @code{0} disallows manual transfer.
  4314. Both default to @code{-1}, which allows any amount to be transferred.
  4315. @end deffn
  4316.  
  4317. @node Changing Sides, Disbanding, Transferring Supply, Unit Actions
  4318.  
  4319. @subsection Changing Sides
  4320.  
  4321. @deffn ActionType @code{change-side} side
  4322. This is the action of changing the actee's side to @var{side}.
  4323. The @var{side} can be any allowable side, and the actee
  4324. may be any unit controlled by the actor's side.
  4325. @end deffn
  4326.  
  4327. @deffn UnitTypeProperty @code{acp-to-change-side} acp
  4328. If the value of this property is greater than 0,
  4329. then this type of unit can be ordered to change to another given side.
  4330. The type must also be allowed to be on the new side.
  4331. Defaults to @code{0}.
  4332. @end deffn
  4333.  
  4334. @node Disbanding, Organization, Changing Sides, Unit Actions
  4335.  
  4336. @subsection Disbanding
  4337.  
  4338. Disbanding is the voluntary and controlled destruction of a unit,
  4339. performed by the unit itself or another unit.
  4340. A disbanded unit always vanishes, rather than changing to its
  4341. @code{wrecked-type}.
  4342.  
  4343. @deffn ActionType @code{disband} unit
  4344. This is the action of removing hp from @var{unit}.
  4345. The unit will vanish if all its hit points are gone.
  4346. @end deffn
  4347.  
  4348. @deffn Table @code{acp-to-disband} u1 u2 -> acp
  4349. This table is the number of action points used by the unit @var{u1} 
  4350. to do a disband action on unit @var{u2}.
  4351. Defaults to @code{0}.
  4352. @end deffn
  4353.  
  4354. @deffn Table @code{hp-per-disband} u1 u2 -> hp
  4355. This table is the number of hp lost in a disband action
  4356. performed by @var{u2}.
  4357. Defaults to @code{0}, which disallows disbanding.
  4358. @end deffn
  4359.  
  4360. A disbanded unit can be scavenged for materials.
  4361.  
  4362. @deffn Table @code{supply-per-disband} u m -> n%
  4363. This table is the percentage of the unit's supply that is recovered
  4364. from a single disband action.
  4365. If the value is zero, then the unit's supply will not be
  4366. recovered by the disbanding process, and be lost permanently.
  4367. If any supply remains when the unit's hp is 0, then that
  4368. supply will be lost also.
  4369. Defaults to @code{100}, which means that the entire supply
  4370. will be recovered on the first disband action.
  4371. @end deffn
  4372.  
  4373. Note that if an essential supply is 100% recovered before the unit
  4374. is completely disbanded, then it may die from starvation first.
  4375. A partly-disbanded unit may still acquire supply
  4376. from nearby units, via the backdrop economy.
  4377.  
  4378. @deffn Table @code{recycleable-material} u m -> n
  4379. This table is the quantity of each type of material that becomes available
  4380. when a unit is completely disbanded.
  4381. The materials go to transports, occupants, and nearby units, in that order.
  4382. Any materials exceeding capacities of these units will be discarded.
  4383. These materials become available only when the unit vanishes.
  4384. Defaults to @code{0}.
  4385. @end deffn
  4386.  
  4387. @node Organization, Combat, Disbanding, Unit Actions
  4388.  
  4389. @subsection Transferring Parts
  4390.  
  4391. Units of variable size can transfer parts of themselves to other
  4392. units, or create a new unit.
  4393.  
  4394. @deffn ActionType @code{transfer-parts} n unit
  4395. This action moves @var{n} parts of the actee to @var{unit},
  4396. or creates a new unit if @var{unit} is omitted.
  4397. If @var{n} is negative, this takes from @var{unit} instead.
  4398. If the action takes all the parts of any involved unit,
  4399. then it vanishes.
  4400. @end deffn
  4401.  
  4402. @deffn UnitTypeProperty @code{acp-to-transfer-part} acp
  4403. Defaults to @code{0}.
  4404. @end deffn
  4405.  
  4406. @subsection Changing Type
  4407.  
  4408. @deffn ActionType @code{change-type} u
  4409. @end deffn
  4410.  
  4411. @deffn Table @code{acp-to-change-type} u1 u2 -> acp
  4412. Defaults to @code{0}.
  4413. @end deffn
  4414.  
  4415. @node Combat, Detonation, Organization, Unit Actions
  4416.  
  4417. @subsection Combat
  4418.  
  4419. Xconq combat is somewhat abstract; the attacking player decides what sort
  4420. of attack to mount and perhaps when to retreat, but all else happens
  4421. automatically.
  4422.  
  4423. Combat may last longer than a single action;
  4424. it is then called a @dfn{battle} and divided into @dfn{rounds}.
  4425. The battle exists until one participant has a commitment of zero.
  4426. Units in a battle need not attack, and no damage will occur if none do so,
  4427. but they cannot move away until no longer committed.
  4428.  
  4429. The attacker/defender distinction applies only to a single action.
  4430.  
  4431. @deffn ActionType @code{attack} unit [commitment]
  4432. This action is a direct attack on the given @var{unit}.
  4433. The @var{unit} must be known to the attacking unit's side.
  4434. @end deffn
  4435.  
  4436. @deffn ActionType @code{overrun} x y z [commitment]
  4437. Overruns are a sort of combined attack/capture/move action.
  4438. The basic theory of an overrun is that the actor will attack,
  4439. capture, or co-occupy the given destination.
  4440. The exact effects depend on the types and sides of units in the destination.
  4441. @end deffn
  4442.  
  4443. @deffn Table @code{acp-to-attack} u1 u2 -> acp
  4444. This table is the number of action points used up by the attacker.
  4445. Defaults to @code{1}.
  4446. @end deffn
  4447.  
  4448. @deffn Table @code{acp-to-defend} u1 u2 -> acp
  4449. This table is the number of action points used up by the defender.
  4450. Defaults to @code{1}.
  4451. @end deffn
  4452.  
  4453. @deffn Table @code{attack-range-min} u1 u2 -> dist
  4454. This table is the minimum distance at which a unit can attack another.
  4455. Defaults to @code{0}.
  4456. @end deffn
  4457.  
  4458. @deffn Table @code{attack-range} u1 u2 -> dist
  4459. This table is the maximum distance at which a unit can attack another.
  4460. Defaults to @code{1}.
  4461. @end deffn
  4462.  
  4463. One round of combat consists of an attack, a reaction,
  4464. and a calculation of effects.
  4465.  
  4466. The defender's reaction is completely automatic, and occurs as part of the
  4467. attack action.  The defender's side does not get a chance to
  4468. decide what to do until the next round,
  4469. although doctrine can constrain the randomness somewhat.
  4470.  
  4471. @deffn Table @code{attack-commit-min??} u1 u2 -> n%
  4472. @end deffn
  4473. @deffn Table @code{defend-commit-min??} u1 u2 -> n%
  4474. These tables are the minimum limits on the initial commitment to a battle.
  4475. Defaults to @code{0}.
  4476. @end deffn
  4477.  
  4478. @deffn Table @code{attack-commit-max??} u1 u2 -> n%
  4479. @end deffn
  4480. @deffn Table @code{defend-commit-max??} u1 u2 -> n%
  4481. These tables are the maximum limits on the initial commitment to a battle.
  4482. Defaults to @code{100}.
  4483. @end deffn
  4484.  
  4485. @deffn Table @code{attack-commit-up-max??} u1 u2 -> n%
  4486. @end deffn
  4487. @deffn Table @code{defend-commit-up-max??} u1 u2 -> n%
  4488. @end deffn
  4489. @deffn Table @code{attack-commit-down-max??} u1 u2 -> n%
  4490. @end deffn
  4491. @deffn Table @code{defend-commit-down-max??} u1 u2 -> n%
  4492. These tables are the maximum limits on the change to commitment to a battle.
  4493. Defaults to @code{100}.
  4494. @end deffn
  4495.  
  4496. @deffn Table @code{surrender-chance-per-attack} u1 u2 -> n%
  4497. This table is the chance that u2 will surrender to u1
  4498. immediately upon being attacked.
  4499. Defaults to @code{0}.
  4500. @end deffn
  4501.  
  4502. @deffn Table @code{withdraw-chance-per-attack} u1 u2 -> n%
  4503. This table is the chance that u2 will retreat from u1
  4504. immediately upon being attacked.
  4505. Defaults to @code{0}.
  4506. @end deffn
  4507.  
  4508. In an overrun action,
  4509. if all the defending units are destroyed,
  4510. the attacker has sufficient acp and mp,
  4511. and the destination is safe to enter,
  4512. then the attacker can move into the defenders' cell.
  4513.  
  4514. Firing is a kind of attack that can take place at a distance,
  4515. involves no commitment or counterattack,
  4516. and for which the type of ammo may be selected.
  4517.  
  4518. @deffn ActionType @code{fire-at} unit [m]
  4519. This is the action of firing at a given @var{unit}.
  4520. If @var{m} is given, then that type will be used as ammo,
  4521. otherwise all available types will be used together.
  4522. @end deffn
  4523.  
  4524. @deffn ActionType @code{fire-into} x y [z] [m]
  4525. This is the action of firing into the cell at @var{x,y}.
  4526. If @var{z} is given, then the fire will be concentrated
  4527. on units at that elevation.
  4528. If @var{m} is given, then that type will be used as ammo,
  4529. otherwise all available types will be used together.
  4530. @end deffn
  4531.  
  4532. @deffn UnitTypeProperty @code{acp-to-fire} acp
  4533. If this property is greater than 0, this type may attack by firing.
  4534. Defaults to @code{0}.
  4535. @end deffn
  4536.  
  4537. @deffn Table @code{acp-to-be-fired-on} u1 u2 -> acp
  4538. This table is the acp lost when a unit is being fired upon.
  4539. Defaults to @code{1}.
  4540. @end deffn
  4541.  
  4542. @deffn UnitTypeProperty @code{range} dist
  4543. This property is the maximum distance to which a unit can fire.
  4544. Defaults to @code{1}.
  4545. @end deffn
  4546.  
  4547. @deffn UnitTypeProperty @code{range-min} dist
  4548. This property is the minimum distance to which a unit can fire.
  4549. Defaults to @code{0}.
  4550. @end deffn
  4551.  
  4552. @deffn UnitTypeProperty @code{elevation-at-max-range} dist
  4553. [elaborate calc to interpolate while rising and falling, basically
  4554. approximating a parabola]
  4555. @end deffn
  4556.  
  4557. @deffn Table @code{hit-falloff-range} u1 u2 -> n
  4558. @end deffn
  4559.  
  4560. @deffn Table @code{hit-at-max-range-effect} u1 u2 -> n
  4561. @end deffn
  4562.  
  4563. Both attack and fire combat calculate hits in the same way.
  4564.  
  4565. @deffn Table @code{hit-chance} u1 u2 -> n%
  4566. This table is the basic chance that a unit of type @var{u1} will
  4567. actually hit a unit of type @var{u2}.
  4568. Defaults to @code{0}.
  4569. @end deffn
  4570.  
  4571. @deffn Table @code{attack-terrain-effect} u1 t -> n%
  4572. @end deffn
  4573. @deffn Table @code{defend-terrain-effect} u2 t -> n%
  4574. These tables specify the
  4575. effect of attacker's and defender's respective terrains on
  4576. @code{hit-chance}.
  4577. These chances are multiplied with the basic hit chance.
  4578. Default to @code{100}.
  4579. @end deffn
  4580.  
  4581. @deffn Table @code{cxp-hit-effect} u1 u2 -> n
  4582. @end deffn
  4583. @deffn Table @code{cxp-damage-effect} u1 u2 -> n
  4584. @end deffn
  4585. @deffn Table @code{cxp-material-effect} u1 u2 -> n
  4586. @end deffn
  4587.  
  4588. @deffn Table @code{friendly-hit-chance} u1 u2 -> n%
  4589. This table is the chance that a unit @var{u2} on the attacker's side will
  4590. be hit accidentally during an @code{overrun} or @code{fire-into}
  4591. action.
  4592. Defaults to @code{0}.
  4593. @end deffn
  4594.  
  4595. [also have surrender/withdraw upon hit with no damage?]
  4596.  
  4597. @deffn Table @code{damage} u1 u2 -> hp
  4598. This table is the basic amount of damage caused by a successful attack.
  4599. The value is a ``dice spec'' [explain somewhere]
  4600. Defaults to @code{1}.
  4601. @end deffn
  4602.  
  4603. The damage in an attack is always prorated by commitment;
  4604. the table value is for attacks at full commitment.
  4605.  
  4606. @deffn Table @code{hp-min} u1 u2 -> hp
  4607. This table is the lowest hp possible for @var{u1} from attacks by @var{u2}.
  4608. Further attacks by @var{u2} are still valid, but have no effect.
  4609. Defaults to @code{0}.
  4610. @end deffn
  4611.  
  4612. You can set a unit to use a material as ammo.
  4613.  
  4614. @deffn Table @code{consumption-per-attack} u1 m -> n
  4615. @end deffn
  4616. @deffn Table @code{hit-by} u2 m -> n
  4617. These tables specify material consumption in combat.
  4618. For each material @code{m}, the min of these two values is the amount
  4619. of u1's supply used up in an attack on u2.
  4620. Both default to @code{0}.
  4621. @end deffn
  4622.  
  4623. @deffn Table @code{material-to-fight} u m -> n
  4624. This table is a minimum of each material that is necessary to either
  4625. attack or defend.
  4626. Defaults to @code{0}.
  4627. @end deffn
  4628.  
  4629. Transports can protect their occupants, or pass hits through.
  4630.  
  4631. @deffn Table @code{protection} u1 u2 -> n%
  4632. @end deffn
  4633.  
  4634. @deffn Table @code{ablation} u1 u2 -> n%
  4635. This table is the amount of the hit that gets passed through
  4636. to the transport's occupants.
  4637. Defaults to @code{100}.
  4638. @end deffn
  4639.  
  4640. @deffn Table @code{stack-protection} u1 u2 -> n%
  4641. @end deffn
  4642.  
  4643. @deffn Table @code{stack-ablation} u1 u2 -> n%
  4644. @end deffn
  4645.  
  4646. [transport's destruction may leave occupants stranded on hex,
  4647. could do some sort of auto-escape or die if terrain is hostile
  4648. use ferry-on-leave to decide]
  4649.  
  4650. [some occupants (like armor) should be able to take hits first,
  4651. then pass to transport - total effect is armor -> unit -> occupants]
  4652.  
  4653. @deffn Table @code{ambush-chance} u1 u2 -> n%
  4654. If @var{u1} attempts to move into a cell containing @var{u2},
  4655. then a) if can't co-occupy, this table is the chance that @var{u1}
  4656. gets a chance to attack at improved odds(?), or if b) if can
  4657. co-occupy, then @var{u1} will enter the cell, then be attacked
  4658. as in a).  The ambusher's plan can flag whether the unit
  4659. will take ambush opportunities or not.
  4660. @end deffn
  4661.  
  4662. Several other side-effects of combat may also be defined.
  4663.  
  4664. @deffn Table @code{theft-chance-per-attack??} u1 u2 -> n%
  4665. @end deffn
  4666.  
  4667. @deffn Table @code{stealable-material??} u m -> n
  4668. @end deffn
  4669.  
  4670. @deffn Table @code{loss-per-attack??} u1 u2 -> n%
  4671. @end deffn
  4672.  
  4673. @deffn Table @code{retreat-chance} u1 u2 -> n%
  4674. This table is the chance that @var{u2} will retreat if hit by @var{u1}.
  4675. Defaults to @code{0}.
  4676. @end deffn
  4677.  
  4678. [need general defns for who moves and when during combat rounds]
  4679. [could potentiall acquire additional acp if move is discretionary,
  4680. also get a level of flexibility about future commitment]
  4681.  
  4682. [need combat's effect on tooling? uu_tp_hit_effect, can be positive
  4683. or negative (being hit helps recruiit soldiers)
  4684. just hit tp randomly as percentage of hp]
  4685.  
  4686. Finally, a unit can attempt to capture another unit directly.
  4687. This means that the unit's side changes to that of the capturing unit,
  4688. but with no other consequences.
  4689.  
  4690. @deffn ActionType @code{capture} unit
  4691. This is the action of capturing the given @var{unit}.
  4692. @end deffn
  4693.  
  4694. @deffn Table @code{acp-to-capture} u1 u2 -> acp
  4695. This table is the number of acp used up by a @code{capture} action.
  4696. Defaults to @code{0}, which disallows capture.
  4697. @end deffn
  4698.  
  4699. @deffn Table @code{capture-chance} u1 u2 -> n%
  4700. This table is the basic chance for @var{u1} to capture @var{u2}.
  4701. Defaults to @code{0}.
  4702. @end deffn
  4703.  
  4704. @deffn Table @code{scuttle-chance} u t -> n%
  4705. This table is the chance that a unit whose capture is guaranteed will disband
  4706. itself entirely instead.  Scuttling is destructive, so unit changes to 
  4707. @code{wrecked-type}.
  4708. Defaults to @code{0}.
  4709. @end deffn
  4710.  
  4711. @deffn Table @code{occupant-escape-chance} u1 u2 -> n%
  4712. This table is the chance that an occupant @var{u1} will escape during the capture
  4713. of a unit of type @var{u2}.
  4714. Occupants that do not escape are either captured themselves or destroyed,
  4715. depending on their type and the capturing unit's side.
  4716. Defaults to @code{0}.
  4717. @end deffn
  4718.  
  4719. @deffn Table @code{hp-to-garrison} u1 u2 -> n
  4720. This table is the number of hp that will be taken from the capturing
  4721. unit @var{u1} in order to guard a captured @var{u2}.
  4722. If the amount is the unit's full hp, then the unit will vanish
  4723. and any occupants will be distributed to the captured unit, to open
  4724. terrain, or will vanish themselves if there is no other option.
  4725. Defaults to @code{0}.
  4726. @end deffn
  4727.  
  4728. @c @deffn Word {@var{bool unit2 unit @code{bridge}}}
  4729. @c True if the unit type @var{unit2} can be captured by another unit
  4730. @c @var{unit}, even across
  4731. @c impassable terrain.
  4732. @c @end deffn
  4733.  
  4734. @deffn UnitTypeProperty @code{attack-up-penalty??} n
  4735. Defaults to @code{0}.
  4736. @end deffn
  4737.  
  4738. @deffn UnitTypeProperty @code{attack-down-penalty??} n
  4739. Defaults to @code{0}.
  4740. @end deffn
  4741.  
  4742. Combat experience affects a unit's ability to hit,
  4743. and the seriousness of hits on itself.
  4744.  
  4745. @deffn Table @code{cxp-hit-plus-max??} u1 u2 -> n%
  4746. This table is the maximum hit modifier for attacker unit.
  4747. Defaults to @code{0}.
  4748. @end deffn
  4749.  
  4750. @deffn Table @code{cxp-hit-minus-max??} u1 u2 -> n%
  4751. This table is the maximum hit modifier for defender unit.
  4752. Defaults to @code{0}.
  4753. The actual hit probability equals the basic hit probability, plus
  4754. @code{experience-hit-plus-max} times fractional experience (i.e.
  4755. experience divided by maximum experience) of the attacking unit, minus 
  4756. @code{experience-hit-minus-max} times fractional experience of the
  4757. defending unit.
  4758. @end deffn
  4759.  
  4760. @deffn Table @code{cxp-per-combat} u1 u2 -> cxp
  4761. This table is the number of combat experience points gained by @var{u1} 
  4762. by surviving a combat round with @var{u2}.
  4763. Defaults to @code{0}.
  4764. @end deffn
  4765.  
  4766. @deffn Table @code{cxp-per-capture} u1 u2 -> ep
  4767. This table is the number of combat experience points gained by @var{u1} 
  4768. by capturing @var{u2}.
  4769. Defaults to @code{0}.
  4770. @end deffn
  4771.  
  4772. @deffn UnitTypeProperty @code{cxp-on-capture-effect} n
  4773. This property gives the change in a unit's cxp due to being captured,
  4774. expressed as a multiplier.
  4775. Defaults to @code{100}.
  4776. @end deffn
  4777.  
  4778. @node Detonation, Terrain Alteration, Combat, Unit Actions
  4779.  
  4780. @subsection Detonation
  4781.  
  4782. Detonation is a sort of cross between disbanding and combat,
  4783. but is a distinct kind of action.
  4784. The action specifies the location of the detonation,
  4785. which may be in the unit's cell or an adjacent one.
  4786. A unit that detonates either loses hp or changes to its
  4787. @code{wrecked-type}.
  4788. (Note that one could then have a unit that detonates multiple times.)
  4789. It also effectively hits every unit in the vicinity.
  4790.  
  4791. @deffn ActionType @code{detonate} x y [z]
  4792. This action detonates the actee at the given location @var{x,y,z}.
  4793. @end deffn
  4794.  
  4795. @deffn UnitTypeProperty @code{acp-to-detonate} acp
  4796. This property is the number of action points used by one detonate action.
  4797. Defaults to @code{0}, which disallows detonation.
  4798. @end deffn
  4799.  
  4800. @deffn UnitTypeProperty @code{hp-per-detonation} hp
  4801. This property is the number of hp lost in each detonation.
  4802. Defaults to @code{0}.
  4803. @end deffn
  4804.  
  4805. @deffn Table @code{detonation-damage-at} u1 u2 -> hp
  4806. This table is the severity of @var{u1}'s hit on a unit @var{u2} in the same cell.
  4807. Defaults to @code{0}.
  4808. @end deffn
  4809.  
  4810. @deffn Table @code{detonation-damage-adjacent} u1 u2 -> hp
  4811. This table is the severity of @var{u1}'s hit on a unit @var{u2} in an adjacent cell.
  4812. Defaults to @code{0}.
  4813. @end deffn
  4814.  
  4815. @deffn Table @code{detonation-range} u1 u2 -> dist
  4816. This table gives the range of effect from detonation of @var{u1}.
  4817. The severity falls off according to the inverse square law
  4818. extrapolated from the adjacent cell damage.
  4819. (1/4 severity at range 2, 1/9 at 3, etc.)
  4820. Defaults to @code{0}.
  4821. @end deffn
  4822.  
  4823. @deffn Table @code{detonate-on-hit} u1 u2 -> n%
  4824. This table is the chance that a hit on @var{u1}
  4825. by a unit of type @var{u2} will cause it to detonate (once).
  4826. Noncombat reductions in hp, such as attrition, have no effect.
  4827. Defaults to @code{0}.
  4828. @end deffn
  4829.  
  4830. @deffn UnitTypeProperty @code{detonate-on-death} n%
  4831. This property is the chance that if this type is about to die from a combat hit,
  4832. it will detonate (once) first.
  4833. Defaults to @code{0}.
  4834. @end deffn
  4835.  
  4836. @deffn Table @code{detonate-on-capture} u1 u2 -> n%
  4837. This table is the chance that this type will detonate before being captured
  4838. by @var{u2}.
  4839. Defaults to @code{0}.
  4840. @end deffn
  4841.  
  4842. @deffn Table @code{detonate-on-approach} u1 u2 -> dist
  4843. When a unit of type @var{u2} on a non-trusted [?] side
  4844. appears at a distance of @var{dist}
  4845. or less, then @var{u1} will detonate. 
  4846. Defaults to @code{0}.
  4847. @end deffn
  4848.  
  4849. @deffn Table @code{detonation-accident-chance} u t -> n.f%
  4850. This table is the chance that the unit will detonate spontaneously.
  4851. This is checked once/turn. [where/when?]
  4852. Defaults to @code{0}.
  4853. @end deffn
  4854.  
  4855. [should rethink??]
  4856.  
  4857. @deffn Table @code{damaged-terrain} t1 t2 -> n
  4858. @end deffn
  4859.  
  4860. @node Terrain Alteration, Type Alteration, Detonation, Unit Actions
  4861.  
  4862. @subsection Altering Terrain
  4863.  
  4864. @deffn ActionType @code{alter-terrain} x y t
  4865. This action changes the type of the cell at @var{x,y} to @var{t}.
  4866. @end deffn
  4867.  
  4868. @deffn ActionType @code{add-terrain} x y dir t
  4869. This action adds a connection or border of type @var{t}
  4870. to the cell at @var{x,y}, in direction @var{dir}.
  4871. @end deffn
  4872.  
  4873. @deffn ActionType @code{remove-terrain} x y dir t
  4874. This action removes a connection or border of type @var{t}
  4875. to the cell at @var{x,y}, in direction @var{dir}.
  4876. @end deffn
  4877.  
  4878. @deffn Table @code{acp-to-add-terrain} u t -> n
  4879. @end deffn
  4880. @deffn Table @code{acp-to-remove-terrain} u t -> n
  4881. For auxiliary terrain types, these tables are the costs to add or remove.
  4882. For cell terrain, the costs of removing the old type and adding the
  4883. new type are added together.
  4884. @end deffn
  4885.  
  4886. @deffn Table @code{alter-terrain-range} u t -> n
  4887. This table is the maximum distance at which a unit can alter terrain @var{t}.
  4888. Defaults to @code{0}, which means that the unit can change only the
  4889. terrain in its own cell.
  4890. @end deffn
  4891.  
  4892. At present, all sides that have seen the terrain once will be informed
  4893. about any changes.
  4894.  
  4895. @section Environmental Computation
  4896.  
  4897. This section describes how to set up backdrop computations
  4898. on the state.
  4899.  
  4900. @subsection Random Parameters
  4901.  
  4902. Environmental conditions may be computed randomly.
  4903.  
  4904. @deffn TerrainTypeProperty @code{temperature-average} n
  4905. This property is the average temperature for each type of terrain.
  4906. Defaults to @code{0}.
  4907. @end deffn
  4908.  
  4909. @deffn TerrainTypeProperty @code{temperature-variability} n
  4910. This property is the amount of totally random variation
  4911. in the temperature in each cell.
  4912. Defaults to @code{0}.
  4913. @end deffn
  4914.  
  4915. [random clouds, etc]
  4916.  
  4917. [have random storms, increase chance in weather extrema if they occur]
  4918.  
  4919. The primary effect of clouds is to make things harder to see.
  4920.  
  4921. @deffn UnitTypeProperty @code{cloud-vision-effect} xxx
  4922. @end deffn
  4923.  
  4924. @subsection Wind Parameters
  4925.  
  4926. @deffn TerrainTypeProperty @code{wind-force-average}
  4927. @end deffn
  4928.  
  4929. @deffn TerrainTypeProperty @code{wind-force-variability}
  4930. @end deffn
  4931.  
  4932. @deffn TerrainTypeProperty @code{wind-variability}
  4933. @end deffn
  4934.  
  4935. @deffn GlobalVariable @code{wind-mix-range}
  4936. This variable is the radius out to which winds interact.
  4937. If 0, then winds in adjacent cells can vary independently
  4938. of each other, and do not interact in any way.
  4939. Defaults to @code{0}.
  4940. @end deffn
  4941.  
  4942. @deffn UnitTypeProperty @code{wind-speed-effect} xxx
  4943. @end deffn
  4944.  
  4945. @deffn UnitTypeProperty @code{wind-angle-effect} xxx
  4946. @end deffn
  4947.  
  4948. @subsection Season Parameters
  4949.  
  4950. @deffn WorldProperty @code{year-length} n
  4951. This property is the number of turns in an annual cycle.
  4952. If less than @code{2}, then no seasonal effects will be calculated.
  4953. Defaults to @code{0}.
  4954. @end deffn
  4955.  
  4956. @deffn WorldProperty @code{day-length} n
  4957. This property is the number of turns in a single day.
  4958. If less than @code{2}, then day and night will not be calculated.
  4959. Defaults to @code{0}.
  4960. @end deffn
  4961.  
  4962. Note that @code{year-length} and @code{day-length} are
  4963. completely independent of each other, and it is possible
  4964. to have days that are longer than years.
  4965.  
  4966. @deffn AreaProperty @code{initial-year-part} n
  4967. This property is the season of the first turn in the game.
  4968. Defaults to @code{0}.
  4969. @end deffn
  4970.  
  4971. @deffn AreaProperty @code{initial-day-part} n
  4972. This property is the hour of the first turn in the game.
  4973. Defaults to @code{0}.
  4974. @end deffn
  4975.  
  4976. [need amount of daylight, twilight, etc]
  4977.  
  4978. @subsection Varying Activity with the Season
  4979.  
  4980. @deffn UnitTypeProperty @code{acp-at-midsummer} acp
  4981. This property is the extra acp that the unit gets at polar midsummer.
  4982. This property is added to the basic @code{acp-per-turn}.
  4983. Defaults to @code{0}.
  4984. @end deffn
  4985.  
  4986. @deffn UnitTypeProperty @code{acp-at-midwinter} acp
  4987. This property is the loss of acp at polar midwinter.
  4988. This property is subtracted from the basic @code{acp-per-turn}.
  4989. Defaults to @code{0}.
  4990. @end deffn
  4991.  
  4992. These values are interpolated according to the cycle's position
  4993. and the unit's latitude.  Both values may be negative.
  4994.  
  4995. @subsection Varying Temperature with the Season
  4996.  
  4997. To make the temperature vary with the season, you set the high and low
  4998. values at the equator and north pole, where the low is always at midwinter
  4999. and the high is always at midsummer.  @i{Xconq} interpolates on both the
  5000. latitude and season to arrive at the average temperature of a location.
  5001. Note that the southern hemisphere will have seasons equal but 
  5002. opposite to those in the north (thus there are no ``south pole parameters'').
  5003.  
  5004. @deffn GlobalVariable @code{temperature-at-midsummer}
  5005. @end deffn
  5006. @deffn GlobalVariable @code{temperature-at-midwinter}
  5007. @end deffn
  5008.  
  5009. [design chapter should mention values 40, 20, 5, -40 make earthlike]
  5010.  
  5011. @deffn TerrainTypeProperty @code{temperature-moderation-range} distance
  5012. This property is the radius of the area whose raw temperatures will be averaged
  5013. to get the actual temperature.
  5014. This can be very slow, so only values of 0 (no averaging) 
  5015. and 1 (average with adjacent cells) are recommended.
  5016. Defaults to @code{0}.
  5017. @end deffn
  5018.  
  5019. The defaults for these values yield reasonable values for Earth-like
  5020. worlds, assuming the temperature is Centigrade.
  5021.  
  5022. @subsection Weather Parameters
  5023.  
  5024. While the seasons change relatively slowly and predictably,
  5025. weather can change drastically from turn to turn.
  5026. @i{Xconq} weather is based on a daily cycle of heating and cooling
  5027. plus the movement of water vapor.
  5028.  
  5029.  
  5030. Weather and seasons can be defined completely independently of each other.
  5031. The weather model assumes a constant basic temperature, set from
  5032. summer-equator if the season model is not being used.
  5033.  
  5034. Atmospheric vapor is modelled by having a vapor quantity in each cell
  5035. [define a layer for this].
  5036. Vapor originates with evaporation from terrain,
  5037. moves around with changing winds and air pressure,
  5038. and high levels result in clouds, rain, and snow.
  5039.  
  5040. @section Environmental Effects
  5041.  
  5042. The environmental conditions include temperature, coatings such as snow,
  5043. and atmospheric conditions.
  5044.  
  5045. [specify these]
  5046.  
  5047. The current environmental conditions in each cell
  5048. [or in world as a whole? or calc by regions?]
  5049. derive from a combination of three calculations:
  5050. random, seasons, and weather.
  5051.  
  5052. @subsection Coating Effects
  5053.  
  5054. [effects of coating should be increased attrition, decreased
  5055. productivity, decreased activity and mobility]
  5056.  
  5057. @subsection Effects of Temperature on Units
  5058.  
  5059. The cell's temperature affects units only if it is outside the unit's
  5060. ``comfort zone''.
  5061. Uncomfortable units have increased attrition, reduced acp and mp.
  5062. [extra consumption?]
  5063.  
  5064. @deffn UnitTypeProperty @code{survival-zone-min} n
  5065. @end deffn
  5066. @deffn UnitTypeProperty @code{survival-zone-max} n
  5067. These properties specify the temperatures above and below which the unit dies
  5068. (vanishes?).
  5069. Default to @code{-9999} and @code{9999}, respectively.
  5070. @end deffn
  5071.  
  5072. @deffn UnitTypeProperty @code{comfort-zone-min} n
  5073. @end deffn
  5074. @deffn UnitTypeProperty @code{comfort-zone-max} n
  5075. These properties are the temperatures within which which the unit is comfortable.
  5076. Default to @code{-9999} and @code{9999}, respectively.
  5077. @end deffn
  5078.  
  5079. Transports can protect their occupants from temperature extremes.
  5080.  
  5081. @deffn Table @code{temperature-protection} u1 u2 -> t/f
  5082. @end deffn
  5083.  
  5084. [any effects of temperature on material production by units and cells?]
  5085.  
  5086. [specify temperature attrition, generic effect, etc]
  5087.  
  5088. @subsection Effects of Lighting on Units
  5089.  
  5090. @deffn Table @code{night-acp-effect} u t -> n
  5091. This table is the multiplier for unit's acp at night in each type of terrain.
  5092. Defaults to @code{100}.
  5093. @end deffn
  5094.  
  5095. @deffn Table @code{night-vision-effect} u t -> n
  5096. This table is the multiplier for unit's vision at night in each type of terrain.
  5097. Defaults to @code{100}.
  5098. @end deffn
  5099.  
  5100. @node Economy, , Random Occurrences, Backdrop Definition
  5101.  
  5102. @section Economy
  5103.  
  5104. The following parameters control the automatic production, distribution, and
  5105. consumption of materials by units and by cells.
  5106.  
  5107. @subsection Unit Production and Consumption
  5108.  
  5109. Units can be set to always produce some amount of material without
  5110. taking explicit action.
  5111.  
  5112. @deffn Table @code{base-production} u m -> n
  5113. This table is the basic amount of each material @var{m}
  5114. produced by a unit of type @var{u} in each turn.
  5115. Defaults to @code{0}.
  5116. @end deffn
  5117.  
  5118. @deffn Table @code{occupant-production} u m -> n
  5119. This table is the base production when unit is an occupant.
  5120. Defaults to @code{0}.
  5121. @end deffn
  5122.  
  5123. @deffn Table @code{productivity} u t -> n%
  5124. This base is the percentage productivity of a unit on a type of terrain.
  5125. This is multiplied with the basic production rate to get actual material
  5126. production, so productivity of @code{0} completely disables production on
  5127. that terrain type, and productivity of @code{100} yields the rate
  5128. specified by @code{base-production}.
  5129. Defaults to @code{100}.
  5130. @end deffn
  5131.  
  5132. @deffn Table @code{productivity-min} u m -> n
  5133. @end deffn
  5134. @deffn Table @code{productivity-max} u m -> n
  5135. These tables are the
  5136. lower and upper bounds on actual production after multiplying by
  5137. productivity.
  5138. Default to @code{0} and @code{9999}, respectively.
  5139. @end deffn
  5140.  
  5141. @deffn Table @code{base-consumption} u m -> n
  5142. This table
  5143. sets the amount of materials consumed by the unit in a turn, even if it
  5144. doesn't move or do anything else.
  5145. Defaults to @code{0}.
  5146. @end deffn
  5147.  
  5148. @deffn Table @code{hp-per-starve} u m -> hp
  5149. If the unit runs out of a material that it must consume,
  5150. this table specifies how many hp it will lose each turn that it is starving.
  5151. If starving for several reasons, loss is max of starvation losses,
  5152. not the sum.
  5153. Defaults to @code{0}.
  5154. @end deffn
  5155.  
  5156. @deffn Table @code{consumption-as-occupant} u m -> n%
  5157. This table is the consumption by a unit of type @var{u1} when it is
  5158. an occupant of @var{u2}, expressed as a percentage
  5159. of its @code{base-consumption}.
  5160. This is useful for
  5161. units such as planes which always consume fuel in the air but not on
  5162. the ground.
  5163. Defaults to @code{100}.
  5164. @end deffn
  5165.  
  5166. @subsection Terrain Production and Consumption
  5167.  
  5168. Materials produced by cells can be redistributed and also taken up
  5169. by units.
  5170.  
  5171. @deffn Table @code{terrain-base-production} t m -> n
  5172. This table is the amount of each material produced by a cell of the given
  5173. type in each turn.
  5174. Defaults to @code{0}.
  5175. @end deffn
  5176.  
  5177. @deffn Table @code{terrain-base-consumption} t m -> n
  5178. This table is the amount of material consumed by a cell each turn.
  5179. If insufficient material is available, then the terrain may change type.
  5180. Defaults to @code{0}.
  5181. @end deffn
  5182.  
  5183. @deffn Table @code{change-on-exhaustion-chance} t m -> n%
  5184. This table is the chance that a cell will change to its exhausted type.
  5185. @end deffn
  5186.  
  5187. @deffn Table @code{terrain-exhaustion-type} t1 m -> t2
  5188. If @var{t2} is @code{non-terrain},
  5189. then this table says that any cell with terrain @var{t1}
  5190. that is ``exhausted'' will change to @var{t2}.
  5191. If several materials are
  5192. exhausted in the same turn, then the lowest-numbered material type
  5193. will determine the new terrain type.
  5194. Defaults to @code{non-terrain}.
  5195. @end deffn
  5196.  
  5197. @deffn Table @code{people-base-consumption} m1 m2 -> n
  5198. This table is the base consumption per turn
  5199. by people of type @var{m1} of each other material type @var{m2}.
  5200. Defaults to @code{0}.
  5201. @end deffn
  5202.  
  5203. @deffn Table @code{people-base-production} m1 m2 -> n
  5204. This table is the people of type @var{m1} base production per turn
  5205. of each other material type @var{m2}.
  5206. Defaults to @code{0}.
  5207. @end deffn
  5208.  
  5209. @subsection Supply Lines
  5210.  
  5211. In real life, material production and consumption rarely occur in the same place
  5212. at the same time.
  5213. For some games, the player must transfer materials
  5214. manually, by loading and unloading from units.
  5215. However, this can be time-consuming and difficult,
  5216. and is best reserved for scarce and/or
  5217. valuable materials.
  5218. For more common materials, @i{Xconq} provides @dfn{supply lines}.
  5219.  
  5220. @deffn Table @code{in-length} u1 m -> dist
  5221. @end deffn
  5222. @deffn Table @code{out-length} u2 m -> dist
  5223. These two tables are used together to determine the length of supply lines
  5224. between units.  The given type of material can only be transferred from
  5225. unit type @var{u1} to unit type @var{u2}
  5226. if the distance is less than the minimum of
  5227. the @code{in-length} of @var{u1} and the @code{out-length} of @var{u2}.
  5228. For instance, the @code{in-length} for a fighter's fuel might be 3 cells,
  5229. while the @code{out-length} of fuel from a city is 4 cells.
  5230. Then the fighter will be constantly supplied with fuel
  5231. when within 3 cells of a city.
  5232. If the fighter's out-length is -1, it will never
  5233. transfer any fuel to the city.
  5234. An in- or out-length of @code{0} means that the two units must be
  5235. in the same cell,
  5236. while a negative length disables the automatic transfer completely.
  5237. Long @code{out-length} lines should be used sparingly,
  5238. since the algorithm uses the @code{out-length} to
  5239. define a radius of search for units to be resupplied.
  5240. Both default to @code{0}.
  5241. @end deffn
  5242.  
  5243. @deffn Table @code{supply-move-rate??} t m -> n
  5244. This table says how much of material @var{m} can be moved through terrain @var{t}
  5245. (cell, border, or connection) in each material transfer action.
  5246. The actual limit is the minimum of all cells and borders
  5247. along the supply route.
  5248. A value of @var{-1} allows any quantity to go through.
  5249. @end deffn
  5250.  
  5251. @deffn Table @code{supply-interdiction??} u m -> n%
  5252. This table is the reduction of supply due to the presence of an enemy unit of the
  5253. given type on the supply line.
  5254. A value of @code{100} means that the unit has no effect on supply movement,
  5255. a value of @code{0} means that the supply line is completely cut.
  5256. Defaults to @code{0}.
  5257. @end deffn
  5258.  
  5259. @subsection Trade Between Units/Sides
  5260.  
  5261. @subsection Trade
  5262.  
  5263. To move materials automatically between cells,
  5264. you must define the demand and supply relationships,
  5265. as well as the rate and distance that materials can move.
  5266.  
  5267. Demand for a material originates with consumption and
  5268. construction needs, issuing either from a side or from
  5269. some other part of the economy.
  5270.  
  5271. @subsection Taxation
  5272.  
  5273. A side can set a taxation rate, which is the amount of material
  5274. that will be taken from the cell-based economy and given to units
  5275. on that side.
  5276.  
  5277. Taxes may be negative, which will have the effect of returning
  5278. materials from units back to cells.
  5279.  
  5280. Taxation is the last step in economic calculations.
  5281.  
  5282. @subsection Material Conversion
  5283.  
  5284. Some types of materials can be converted or combined into other types
  5285. of materials.
  5286.  
  5287. [do by letting production vary according to consumption?]
  5288.  
  5289. [in general, should distinguish productive from consumptive units,
  5290. specify as limits on in/out for each rtype]
  5291.  
  5292. @section Random Events
  5293.  
  5294. [check validity of random event list after loading]
  5295.  
  5296. @deffn GlobalVariable @code{random-events} method-list
  5297. This variable is a list (actually a set) of random event methods
  5298. that will be run at the end of each turn.
  5299. @end deffn
  5300.  
  5301. @subsection Terrain Attrition
  5302.  
  5303. Attrition is the automatic loss of hit points due to being in certain types
  5304. of terrain.
  5305.  
  5306. @deffn Method @code{attrition-in-terrain}
  5307. For every unit not in a transport,
  5308. this method computes the chance to lose hit points,
  5309. then damages the unit accordingly.
  5310. This method runs once per turn.
  5311. @end deffn
  5312.  
  5313. @deffn Table @code{attrition} u t -> .01hp
  5314. This table is the rate of loss of hp per turn.
  5315. The terrain used is cell or connection terrain as appropriate for
  5316. the unit's position.
  5317. Defaults to @code{0}.
  5318. @end deffn
  5319.  
  5320. @subsection Terrain Accident
  5321.  
  5322. Accidents result in the damage or disappearance of a unit in the open
  5323. in some kinds of terrain.
  5324.  
  5325. @deffn Method @code{accidents-in-terrain}
  5326. For every unit not in a transport,
  5327. this method computes the chance to be hit or to vanish completely.
  5328. This method runs once per turn.
  5329. @end deffn
  5330.  
  5331. @deffn Table @code{accident-hit-chance} u t -> .01n%
  5332. This table is the chance of the unit being hit while in the given terrain.
  5333. Defaults to @code{0}.
  5334. @end deffn
  5335.  
  5336. @deffn Table @code{accident-damage} u t -> hp
  5337. This table is the hp that will be lost in an accident.
  5338. Defaults to @code{0}.
  5339. @end deffn
  5340.  
  5341. @deffn Table @code{accident-vanish-chance} u t -> .01n%
  5342. This table is the chance of the unit simply vanishing while in the given terrain.
  5343. Defaults to @code{0}.
  5344. @end deffn
  5345.  
  5346. @subsection Revolt
  5347.  
  5348. Revolt is a spontaneous change of side,
  5349. occurring in place of a side-given unit action.
  5350. The new side may be none (independence) or another side.
  5351. [only if other side wants it?] [50/50 chance?]
  5352.  
  5353. @deffn Method @code{units-revolt}
  5354. For each completed unit, this method decides whether the unit revolts,
  5355. then changes its side.
  5356. @end deffn
  5357.  
  5358. @deffn UnitTypeProperty @code{revolt-chance} n.01%
  5359. This property is the chance for the unit to revolt spontaneously.
  5360. Defaults to @code{0}.
  5361. @end deffn
  5362.  
  5363. @subsection Surrender
  5364.  
  5365. @deffn Method @code{units-surrender}
  5366. @end deffn
  5367.  
  5368. @deffn Table @code{surrender-chance} u1 u2 -> n
  5369. This table is the chance that a unit of type @var{u1} will change its side
  5370. to match the side of a unit @var{u2} that is within the @code{surrender-range}
  5371. for the two types.
  5372. Defaults to @code{0}.
  5373. @end deffn
  5374.  
  5375. @deffn Table @code{surrender-range} u1 u2 -> dist
  5376. This table is the distance out to which a unit of type @var{u1}
  5377. will surrender to a unit of type @var{u2}.
  5378. Defaults to @code{0}.
  5379. @end deffn
  5380.  
  5381. @node Random State, Chrome, Populations, Miscellany
  5382.  
  5383. @section The Random State
  5384.  
  5385. It is occasionally useful to restart the random number generator
  5386. consistently.
  5387.  
  5388. @deffn GlobalVariable @code{random-state} n
  5389. This variable is the state of the random number generator.
  5390. If this is not used, then the initial state of the random number
  5391. generator will be set in a system-dependent way.
  5392. @end deffn
  5393.  
  5394. @section Default Display Style
  5395.  
  5396. The exact style of display depends on the user interface and
  5397. on user preferences,
  5398. but for some games, you may want to encourage a particular style
  5399. by making it be the default.
  5400.  
  5401. @deffn GlobalVariable @code{unseen-char} str
  5402. This variable is the name of a character that will be used to
  5403. represent unexplored terrain.
  5404. Defaults to @code{" "}.
  5405. @end deffn
  5406.  
  5407. @deffn GlobalVariable @code{unseen-color} str
  5408. This variable is the name of a color that will be used to
  5409. represent unexplored terrain.
  5410. Defaults to @code{""}.
  5411. @end deffn
  5412.  
  5413. @deffn GlobalVariable @code{unseen-image-name} str
  5414. This variable is the name of an image that will be used to
  5415. represent unexplored terrain.
  5416. Defaults to @code{""}.
  5417. @end deffn
  5418.  
  5419. @deffn GlobalVariable @code{grid-color} str
  5420. This variable is the name of a color to use to draw the
  5421. cell-separating grid.
  5422. Defaults to @code{""}.
  5423. @end deffn
  5424.  
  5425. @section Dates and Time
  5426.  
  5427. You can make @i{Xconq} display game time as a calendar date,
  5428. rather than as a simple turn number.
  5429.  
  5430. @deffn GlobalVariable @code{calendar} xxx
  5431. This variable is the description of the calendar type that will be used.
  5432. If @code{"none"}, then turns will be reported numerically starting
  5433. from @code{1}.  If @code{"usual"}, then our present-day Gregorian
  5434. calendar will be used.
  5435. (Other calendars may be supported in the future.)
  5436. Defaults to @code{()}.
  5437.  
  5438. This is how long a turn is, in terms of the calendar.  For instance,
  5439. if the usual calendar is being used, then a time measure of @code{"day"}
  5440. (and a base date of @code{"1 Jan 1900"}) will result in turns
  5441. @code{"1 Jan 1900"}, @code{"2 Jan 1900"}, etc,
  5442. while a date unit of @code{"year"}
  5443. will yield just @code{"1900"}, @code{"1901"}, and so forth.
  5444. If the numeric calendar is in use, then the time measure @code{"day"}
  5445. will yield @code{"day 1"}, @code{"day 2"}, etc.
  5446.  
  5447. (Eventually it is intended to support multiples of units, such as
  5448. "2 day", which will just display every other day as a turn.)
  5449. @end deffn
  5450.  
  5451. @deffn Symbol @code{usual}
  5452. @end deffn
  5453.  
  5454. @deffn GlobalVariable @code{calendar-part-names} {((n1 n2 name)@dots{})}
  5455. This variable lists the name of each season and the turns within a year
  5456. for which it is appropriate.
  5457. A twelve-month year with four seasons could be
  5458. @example
  5459. ((0 2 "winter") (3 5 "spring") (6 8 "summer") (9 11 "autumn"))
  5460. @end example
  5461. If any number ranges overlap, then the first match will be used,
  5462. while if a particular turn has no named season, then it will go
  5463. unnamed in the display.
  5464. Defaults to @code{()}.
  5465. @end deffn
  5466.  
  5467. @deffn GlobalVariable @code{initial-date}
  5468. This variable is the date, in the specified calendar system, of the first turn.
  5469. Defaults to @code{""}, which has the effect of setting the initial date
  5470. to be whatever the calendar does with turn number 1.
  5471. @end deffn
  5472.  
  5473. @deffn GlobalVariable @code{turn} n
  5474. This variable is the date of the current turn.
  5475. [written correctly?]
  5476. Defaults to @code{0}.
  5477. @end deffn
  5478.  
  5479. @deffn GlobalVariable @code{last-turn} n
  5480. This variable is the date, in the specified calendar system,
  5481. of the last turn.
  5482. Defaults to @code{-1}, which means that there is no limit on the number
  5483. of turns.
  5484. @end deffn
  5485.  
  5486. @deffn GlobalVariable @code{extra-turn-chance} n%
  5487. This variable is the chance that the game will go one more turn
  5488. after the @code{last-turn}.
  5489. @end deffn
  5490.  
  5491. @i{Xconq} is currently limited to games of 32,767 turns.
  5492.  
  5493. A game may also be limited in real time.
  5494.  
  5495. @deffn GlobalVariable @code{real-time-for-game} seconds
  5496. @end deffn
  5497.  
  5498. @deffn GlobalVariable @code{real-time-per-turn} seconds
  5499. @end deffn
  5500.  
  5501. @deffn GlobalVariable @code{real-time-per-side} seconds
  5502. @end deffn
  5503.  
  5504. @deffn GlobalVariable @code{elapsed-real-time} seconds
  5505. @end deffn
  5506.  
  5507. @section Miscellany
  5508.  
  5509. @deffn UnitTypeProperty @code{name-internal} str
  5510. Internally used type name.
  5511. @end deffn
  5512.  
  5513. @subsection Debugging
  5514.  
  5515. @deffn Form @code{print} value
  5516. This form prints to a console (or whatever the interface provides)
  5517. the object @var{value}, in GDL syntax.
  5518. @end deffn
  5519.  
  5520. @subsection AI Data
  5521.  
  5522. These are computed and used internally by AIs.
  5523.  
  5524. @deffn XXX @code{zzz-fr}
  5525. @end deffn
  5526.  
  5527. @deffn XXX @code{zzz-uaw}
  5528. @end deffn
  5529.  
  5530. @deffn XXX @code{zzz-dw}
  5531. @end deffn
  5532.  
  5533. @deffn XXX @code{zzz-ew}
  5534. @end deffn
  5535.  
  5536. @deffn XXX @code{zzz-mrs}
  5537. @end deffn
  5538.  
  5539. @deffn XXX @code{zzz-b}
  5540. @end deffn
  5541.  
  5542. @deffn XXX @code{zzz-bb}
  5543. @end deffn
  5544.  
  5545. @deffn XXX @code{zzz-transport}
  5546. @end deffn
  5547.  
  5548. @deffn XXX @code{zzz-c}
  5549. @end deffn
  5550.  
  5551. @deffn XXX @code{zzz-cm}
  5552. @end deffn
  5553.  
  5554. @deffn XXX @code{zzz-cc}
  5555. @end deffn
  5556.  
  5557. @deffn XXX @code{zzz-uh}
  5558. @end deffn
  5559.  
  5560. @deffn XXX @code{zzz-bw}
  5561. @end deffn
  5562.  
  5563. @deffn XXX @code{zzz-abt}
  5564. @end deffn
  5565.  
  5566. @deffn XXX @code{zzz-bhw}
  5567. @end deffn
  5568.  
  5569. @deffn XXX @code{zzz-bcw}
  5570. @end deffn
  5571.